Bil*_*med 1 sql-server jdbc elasticsearch logstash centos7
我正在尝试通过 Logstash 将 MS Sql Server 数据与 ElasticSearch 同步我正在按照 Elastic 文档中的建议设置配置。所有的东西(MS SQL、ES 和 LogStash)都设置在具有 CentOS 7 环境的同一台服务器上
我试图用它设置所有可能的 JDBC Jar,这些 Jar 与我的 JDK(1.8.0_131) 兼容。此外,我还提供了 Jar 的正确路径。
下面是我的 SQL.conf:
input {
jdbc {
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_driver_library => "/root/sqljdbc_6.4/enu/mssql-jdbc-6.4.0.jre8.jar"
jdbc_connection_string => "jdbc:sqlserver://localhost:1433;databaseName=test"
jdbc_user => "sa"
jdbc_password => "abc.123"
statement => "select * from Service"
}
}
output {
elasticsearch {
hosts => ["http://localhost:9200/"]
index => "Service"
document_id => "%{service_id}"
}
}
Run Code Online (Sandbox Code Playgroud)
错误:com.microsoft.sqlserver.jdbc.SQLServerDriver 未加载。您确定在 :jdbc_driver_library 中包含了正确的 jdbc 驱动程序吗?
我建议将 JAR 文件移动到其他地方而不是下面,/root因为 Logstash 可能无法在那里读取:
jdbc_driver_library => "/tmp/sqljdbc_6.4/enu/mssql-jdbc-6.4.0.jre8.jar"
^
|
change the folder
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
134 次 |
| 最近记录: |