【发布时间】:2020-01-08 07:53:55
【问题描述】:
我已经安装了 logsatsh 7.2,我正在尝试配置从 Solarwinds DB 获取数据。 我正在使用以下 Logstash 配置:
input {
jdbc {
jdbc_connection_string => "jdbc:sqlserver://SOLARWINS:5674;databasename=Orion_DB;integratedSecurity=true"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_driver_library => "/etc/logstash/mssql-jdbc-7.4.1.jre8.jar"
jdbc_user => "logstash"
jdbc_password => "pass123"
statement => "SELECT * from events"
}
}
output {
elasticsearch { hosts => ["10.26.67.29:9200"]
index => "swdata"
}
stdout { codec => rubydebug }
}
我收到一条错误消息:
[2020-01-08T01:57:19,264][ERROR][logstash.inputs.jdbc ] Unable to connect to database. Tried 1 times {:error_message=>"Java::ComMicrosoftSqlserverJdbc::SQLServerException: This driver is not configured for integrated authentication. ClientConnectionId:ef93944c-9f83-44d3-a370-254903b671ef"}
[2020-01-08T01:57:19,265][ERROR][logstash.javapipeline ] A plugin had an unrecoverable error. Will restart this plugin.
Pipeline_id:sw
Plugin: <LogStash::Inputs::Jdbc jdbc_user=>"sa_logstash", jdbc_password=><password>, statement=>"SELECT * from events", jdbc_driver_library=>"/etc/logstash/mssql-jdbc-7.4.1.jre8.jar", jdbc_connection_string=>"jdbc:sqlserver://SOLARWINS:5674;databasename=Orion_DB;integratedSecurity=true", id=>"3c6c347831ec1a9a964da106925ef193a86d1d52adf190f9bd046d6b408e3e2b", jdbc_driver_class=>"com.microsoft.sqlserver.jdbc.SQLServerDriver", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_52f36adf-96b9-44a1-8e8c-40b2f009ebd2", enable_metric=>true, charset=>"UTF-8">, jdbc_paging_enabled=>false, jdbc_page_size=>100000, jdbc_validate_connection=>false, jdbc_validation_timeout=>3600, jdbc_pool_timeout=>5, sql_log_level=>"info", connection_retry_attempts=>1, connection_retry_attempts_wait_time=>0.5, parameters=>{"sql_last_value"=>2020-01-07 12:18:53 UTC}, last_run_metadata_path=>"/usr/share/logstash/.logstash_jdbc_last_run", use_column_value=>false, tracking_column_type=>"numeric", clean_run=>false, record_last_run=>true, lowercase_column_names=>true>
Error: Java::ComMicrosoftSqlserverJdbc::SQLServerException: This driver is not configured for integrated authentication. ClientConnectionId:ef93944c-9f83-44d3-a370-254903b671ef
Exception: Sequel::DatabaseConnectionError
现在, 我的 Solarwinds 在 Windows 中,而我的 Logstash 在 Linux 中。我看到这可能是一个潜在的问题。 但我不完全明白我能做些什么。
我需要在配置文件中进行哪些更改才能启用连接?
更新: 我将连接字符串更改为
jdbc_connection_string => "jdbc:sqlserver://STRPROAG01:32452;databasename=Orion_DB;integratedSecurity=true;authenticationScheme=JavaKerberos"
新的错误日志:
[2020-01-08T04:36:56,186][ERROR][logstash.inputs.jdbc ] Unable to connect to database. Tried 1 times
{:error_message=>"Java::ComMicrosoftSqlserverJdbc::SQLServerException: Integrated authentication failed. ClientConnectionId:dd8a0cae-cbc1-4a8b-94aa-a3186e810e94"}
[2020-01-08T04:36:56,189][ERROR][logstash.javapipeline ] ntAuthInit(com/microsoft/sqlserver/jdbc/KerbAuthentication.java:125)
【问题讨论】:
标签: sql-server jdbc logstash elastic-stack mssql-jdbc