由jdbc导入的Logstash无法连接到sqlServer Express

时间:2017-01-04 22:56:53

标签: elasticsearch jdbc logstash

我想使用JDBC SQL Server作为输入使用Logstash在ElasticSearch中导入数据,我尝试应用此help page 我有感觉wat是预期但logstash抛出一个错误告诉我它无法连接到我的源数据库

 input {
      jdbc {
       jdbc_driver_library => "C:\logstash-5.1.1\driver\sqljdbc_6.0\enu\sqljdbc42.jar"
       jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
       jdbc_connection_string => "jdbc:sqlserver://(LocalDb)\MSSQLLocalDB;databaseName=testDB;Integrated Security=true"
       jdbc_user => "myUsername"
       #jdbc_password => "YOUR DATABASE PASSWORD, IF YOU DONT HAVE ONE REMOVE jdbc_password"
       statement => " select * from CUSTOMERS "
       }
     }
     output {
        stdout { codec => json_lines }
    }

它给我写了一个错误:

     23:30:32.808 [[main]-pipeline-manager] ERROR logstash.agent - Pipeline aborted due to error 
{:exception=>#<Sequel::DatabaseConnectionError: Java::ComMicrosoftSqlserverJdbc::SQLServerException: ??chec de la connexion Ó l'h¶te (LocalDb), 
instance nommÚe mssqllocaldb. Erreurá: ½ájava.net.UnknownHostException: (LocalDb)á╗. 
VÚrifiez le nom du serveur et celui de l'instance et assurez-vous qu'aucun pare-feu ne bloque le trafic UDP vers le portá1434. 
Pour SQL Server 2005 ou version ultÚrieure, vÚrifiez que le service SQL Server Browser est en cours d'exÚcution sur l'h¶te.>, :backtrace=>["com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(com/microsoft/sqlserver/jdbc/SQLServerException.java:191)", "com.microsoft.sqlserver.jdbc.SQLServerConnection.getInstancePort(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:5189)", "com.microsoft.sqlserver.jdbc.SQLServerConnection.primaryPermissionCheck(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:1870)", "com.microsoft.sqlserver.jdbc.SQLServerConnection.login(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:1607)", "com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:1458)", "com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:772)", "com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(com/microsoft/sqlserver/jdbc/SQLServerDriver.java:1168)", "RUBY.connect(c:/logstash-5.1.1/vendor/bundle/jruby/1.9/gems/sequel-4.41.0/lib/sequel/adapters/jdbc.rb:222)", "RUBY.make_new(c:/logstash-5.1.1/vendor/bundle/jruby/1.9/gems/sequel-4.41.0/lib/sequel/connection_pool.rb:116)", "RUBY.make_new(c:/logstash-5.1.1/vendor/bundle/jruby/1.9/gems/sequel-4.41.0/lib/sequel/connection_pool/threaded.rb:228)", "RUBY.available(c:/logstash-5.1.1/vendor/bundle/jruby/1.9/gems/sequel-4.41.0/lib/sequel/connection_pool/threaded.rb:201)", "RUBY._acquire(c:/logstash-5.1.1/vendor/bundle/jruby/1.9/gems/sequel-4.41.0/lib/sequel/connection_pool/threaded.rb:137)", "RUBY.acquire(c:/logstash-5.1.1/vendor/bundle/jruby/1.9/gems/sequel-4.41.0/lib/sequel/connection_pool/threaded.rb:151)", "RUBY.sync(c:/logstash-5.1.1/vendor/bundle/jruby/1.9/gems/sequel-4.41.0/lib/sequel/connection_pool/threaded.rb:282)", "org.jruby.ext.thread.Mutex.synchronize(org/jruby/ext/thread/Mutex.java:149)", "RUBY.sync(c:/logstash-5.1.1/vendor/bundle/jruby/1.9/gems/sequel-4.41.0/lib/sequel/connection_pool/threaded.rb:282)", "RUBY.acquire(c:/logstash-5.1.1/vendor/bundle/jruby/1.9/gems/sequel-4.41.0/lib/sequel/connection_pool/threaded.rb:150)", "RUBY.hold(c:/logstash-5.1.1/vendor/bundle/jruby/1.9/gems/sequel-4.41.0/lib/sequel/connection_pool/threaded.rb:106)", "RUBY.synchronize(c:/logstash-5.1.1/vendor/bundle/jruby/1.9/gems/sequel-4.41.0/lib/sequel/database/connecting.rb:285)", "RUBY.test_connection(c:/logstash-5.1.1/vendor/bundle/jruby/1.9/gems/sequel-4.41.0/lib/sequel/database/connecting.rb:295)", "RUBY.prepare_jdbc_connection(c:/logstash-5.1.1/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.1.3/lib/logstash/plugin_mixins/jdbc.rb:171)", "RUBY.register(c:/logstash-5.1.1/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.1.3/lib/logstash/inputs/jdbc.rb:191)", "RUBY.start_inputs(c:/logstash-5.1.1/logstash-core/lib/logstash/pipeline.rb:353)", "org.jruby.RubyArray.each(org/jruby/RubyArray.java:1613)", "RUBY.start_inputs(c:/logstash-5.1.1/logstash-core/lib/logstash/pipeline.rb:352)", "RUBY.start_workers(c:/logstash-5.1.1/logstash-core/lib/logstash/pipeline.rb:228)", "RUBY.run(c:/logstash-5.1.1/logstash-core/lib/logstash/pipeline.rb:183)", "RUBY.start_pipeline(c:/logstash-5.1.1/logstash-core/lib/logstash/agent.rb:292)"]}
23:30:32.889 [Api Webserver] INFO  logstash.agent - Successfully started Logstash API endpoint {:port=>9600}
23:30:35.810 [LogStash::Runner] WARN  logstash.agent - stopping pipeline {:id=>"main"}

简短翻译:它首先告诉我与数据源的连接失败

你知道为什么会这样吗?

0 个答案:

没有答案