MongoDB
 sql >> Database >  >> NoSQL >> MongoDB

Sincronizza MongoDb con ElasticSearch

  1. scarica https://dbschema.com/jdbc-drivers/MongoDbJdbcDriver.zip
  2. decomprimi e copia tutti i file nel percorso(~/logstash-7.4.2/logstash-core/lib/jars/)
  3. modifica il file di configurazione (mongo-logstash.conf) di seguito:
  4. esegui:~/logstash-7.4.2/bin/logstash -f mongo-logstash.conf
  5. successo, per favore prova!

ps:questa è la mia prima risposta in StackOverflow :-)

input {
  jdbc{
    # NOT THIS # jdbc_driver_class => "Java::mongodb.jdbc.MongoDriver"
    jdbc_driver_class => "com.dbschema.MongoJdbcDriver"
    jdbc_driver_library => "mongojdbc1.5.jar"
    jdbc_user => "" #no user and pwd
    jdbc_password => ""
    jdbc_connection_string => "jdbc:mongodb://127.0.0.1:27017/db1"
    statement => "db.t1.find()"
  }
}

output {
    #stdout { codec => dots }
    stdout { }
}