Logstash JDBC插件Cassandra驱动程序不起作用

时间:2019-12-27 14:09:53

标签: java jdbc cassandra logstash

我正在使用具有不同数据库的Logstash输入Jdbc,主要是我尝试使用cassandra并使用DBSchema驱动程序,该驱动程序可以正常使用我的Java代码,但是当与Logstash集成时,它无法连接,我正在尝试从很多天开始,我没有找到任何确切的解决方案。 在这里,我在启动Logstash时提供日志

卡桑德拉原木:

  

错误] 2019-12-25 17:37:33.621 [[main]“ Java :: JavaLang :: NoClassDefFoundError:com / datastax / driver / core / policies / RetryPolicy”}
  [ERROR] 2019-12-25 17:37:33.622 [[main]

Logstash conf文件:(Cassandra)

Sample Logstash configuration for creating a simple
Beats -> Logstash -> Elasticsearch pipeline.
input {
jdbc {
clean_run => true
jdbc_connection_string => "jdbc:cassandra://localhost:9042/cloud"
jdbc_user => "cassandra"
jdbc_password => "cassandra"
jdbc_driver_library => "/usr/share/logstash/logstash-core/lib/jars/cassandrajdbc1.2.jar"
jdbc_validate_connection => true
jdbc_driver_class => "com.dbschema.CassandraJdbcDriver"
statement => "SELECT * FROM cloud.event_history_all"
}
}

output {
elasticsearch { hosts => ["localhost:9200"]
index => "pan_details" }
stdout { codec => rubydebug }
}

与MariaDb也尝试过 conf:

jdbc_driver_library => "/usr/share/logstash/logstash-core/lib/jars/mariadb-java-client-2.4.2.jar"
    jdbc_validate_connection => true
    jdbc_driver_class => "org.mariadb.jdbc.Driver"

日志:

 Error: com.mysql.jdbc.Driver not loaded, try installing jdbc-mysql gem
  Exception: Sequel::AdapterNotFound
  Stack: /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.25.0/lib/sequel/adapters/jdbc.rb:56:in `load_driver'
    /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.25.0/lib/sequel/adapters/jdbc/mysql.rb:3:in `<main>'

Cassandra版本-3.11.5
麋鹿版本-7.4.2
Java版本-11.0.5

0 个答案:

没有答案