Logstash 輸入 MongoDB 錯誤“找不到適合 jdbc:mongo://localhost:27017/test 的驅動程序”
logasth conf“輸入部分”
input { jdbc { jdbc_driver_library => "/home/jskang/mongo-java-driver-3.2.2.jar" jdbc_driver_class => "com.mongodb.MongoClient" jdbc_connection_string => "jdbc:mongodb://localhost:27017/test" jdbc_user => "" statement => "db.noobject.find()" } }
和錯誤列印。
$$ ERROR $$$$ logstash.pipeline $$外掛出現不可恢復的錯誤。將重新啟動此外掛。外掛:"/home/jskang/mongo-java-driver-3.2.2.jar", jdbc_driver_class=>“com.mongodb.MongoClient”, jdbc_connection_string=>“jdbc:mongodb://localhost:27017/test”, 語句=>“db.noobject.find()”, id=>“df4ccfb18e5d04b6996063d547474649d5b7942a-1”, enable_metric=>true, codec=>“plain_d07acd49-a189-4c04-b8bf-7bae6f423c49”, 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”=>1970-01-01 00:00:00 UTC},
為什麼不啟動logstash!?我不知道… :(
我遇到了相同類型的錯誤,然後重新安裝了 mongo 的 jdbc 驅動程序並配置如下,
jdbc { jdbc_connection_string => "jdbc:mongo://xxx.xxx.xxx.xxx:27017/database" jdbc_user => "user" jdbc_password => "password" jdbc_driver_library => "/etc/logstash/mongodb-java-driver-3.4.2.jar" jdbc_driver_class => "com.mongodb.MongoClient" statement => "SELECT * FROM table" schedule => "*/30 * * * *" tags => "mongodb"
}