Error: mongodb.jdbc.MongoDriver not loaded. Are yo

2019-08-23 05:38发布

Am trying to load mogodb database to elastic search using logstash. I have written below logstash config file and executing it. While running the config file am getting the below error :

  Error: mongodb.jdbc.MongoDriver not loaded. Are you sure you've included the correct jdbc driver in :jdbc_driver_library?
  Exception: LogStash::ConfigurationError

Am using mongo-java-driver-3.1.0.jar driver. Please find my logstash config code below.

    input {
  jdbc {

    jdbc_driver_library => "D:\1SearchEngine\data\mongo-java-driver-3.1.0.jar"
    jdbc_driver_class => "mongodb.jdbc.MongoDriver"
    jdbc_connection_string => "jdbc:mongodb://localhost:27017/my_db"
    jdbc_user => ""
    statement => "*"
  }
}

output {
  elasticsearch {
    hosts => ["localhost:9200"]
    index => "orders"
  }
}

2条回答
ら.Afraid
2楼-- · 2019-08-23 06:14

Paths on Windows are a little wonky. I cannot verify this at the moment, but in the past I had to use a preceding / before the drive letter. And then all / for the path separators. So give this a try:

jdbc_driver_library => "/D:/1SearchEngine/data/mongo-java-driver-3.1.0.jar"

查看更多
倾城 Initia
3楼-- · 2019-08-23 06:24

try with mongodb_unityjdbc_full.jar instead of ojdbc14.jar

https://github.com/michaelloliveira/traccar-mongodb/blob/master/lib/mongodb_unityjdbc_full.jar

on windows try:

try double anti slash: (without the space between)

jdbc_driver_library => "D:\ \1SearchEngine\ \data\ \mongo-java-driver-3.1.0.jar"

or try single slash:

jdbc_driver_library => "D:/1SearchEngine/data/mongo-java-driver-3.1.0.jar"
查看更多
登录 后发表回答