richardwilly98 / elasticsearch-river-mongodb

MongoDB River Plugin for ElasticSearch
1.12k stars 215 forks source link

ELASTICSEARCH connect MONGOLAB BDD seems empty #583

Open gsarfati opened 8 years ago

gsarfati commented 8 years ago

Hello, I'm trying to connect elasticsearch hosted on aws ec2 to my database Mongo DB hosted on MongoLab with elasticsearch-river-mongodb , I created a user oplog..

There is no problem when connect elasticsearch with mongodb hosted in the same server without credentials, there is no problem when connect to hosted mongodb via mongo driver too but when I'm trying to connect with mongolab there is no error but the bdd seems empty. I think my credential syntax with elasticsearch-river-mongodb is wrong , can you help me ? Thank you !

elasticsearch version 1.7.3 mongodb version 2.6.12 elasticsearch-river-mongodb version 2.0.11 elasticsearch-mapper-attachments version 2.7.1

curl -XPUT "127.0.0.1:9200/_river/Customer/_meta" -d '
{
  "type": "mongodb",
  "mongodb": {
    "servers": [
      { 
        "host": "ds012345-a0.mlab.com",
        "port": 19202
      }
    ],
     "credentials": [
      { "db": "production", "user": "api", "password": "XXX" },
      { "db": "admin", "user": "elasticsearch", "password": "XXXX" }
    ],
    "options": { "secondary_read_preference": true },
    "db": "production",
    "collection": "Customer"
 },
  "index": {
    "name": "Customer",
    "type": "Customer"
  }
}'