Connect logstash with Cassandra and send data to Elastic


(Prashant Agrawal) #1

Hi Team :
I am trying to import data from Cassandra to Elastic using logstash jdbc , but I am getting an error as org.apache.cassandra.cql.jdbc.CassandraDriver not loaded. where as I added the jar and class path as below:

jdbc {
jdbc_connection_string => "jdbc:cassandra://localhost:9042"
jdbc_user => ""
jdbc_password => ""
jdbc_driver_library => "/root/cassandra-jdbc-1.2.5.jar"
jdbc_driver_class => "org.apache.cassandra.cql.jdbc.CassandraDriver"
statement => "SELECT * FROM keyspace.table"
}
}

output {
stdout {
codec => rubydebug
}
}
 

I have downloaded the cassandra-jdbc-1.2.5.jar from http://www.java2s.com/Code/Jar/c/Downloadcassandrajdbc125jar.htm, which does have org.apache.cassandra.cql.jdbc.CassandraDriver as I checked by jar xf jar_name.

Full Exception :
[2017-04-18T16:44:06,709][ERROR][logstash.agent ] Pipeline aborted due to error {:exception=>#<LogStash::ConfigurationError: org.apache.cassandra.cql.jdbc.CassandraDriver not loaded. Are you sure you've included the correct jdbc driver in :jdbc_driver_library?>, :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.1.3/lib/logstash/plugin_mixins/jdbc.rb:157:in `prepare_jdbc_connection'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.1.3/lib/logstash/inputs/jdbc.rb:191:in `register'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:257:in `register_plugin'",

So is there anything I am doing wrong, if someone have any idea please let me know`


(Mark Walkom) #2

Can the Logstash user read that jdbc file?


(Prashant Agrawal) #3

Yes, it can , I even tried giving the 777 permission to jdbc jar file.


(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.