Search code examples
mongodbelasticsearchelasticsearch-plugin

Elasticsearch and MongoDB: no river _meta document found after 5 attempts


I have a MongoDB database named news to which I tried to index with ES. Using these plugins:

richardwilly98.elasticsearch/elasticsearch-river-mongodb/2.0.9 and elasticsearch/elasticsearch-mapper-attachments/2.5.0

This is what happening when I tried to create the index. I have tried to delete the index and recreating it, without that helping.

$ curl -XPUT 'http://localhost:9200/_river/news/_meta' -d @init.json

init.json

{
"type": "mongodb",
"mongodb": {
    "db": "news",
    "collection": "entries"
},
"index": {
    "name": "news",
    "type": "entries"
}
}

Here is a log

update_mapping [mongodb] (dynamic)
MongoDB River Plugin - version[2.0.9] - hash[73ddea5] - time[2015-04-06T21:16:46Z]
setRiverStatus called with mongodb - RUNNING
river mongodb startup pending
Starting river mongodb
MongoDB options: secondaryreadpreference [false], drop_collection [false], 
include_collection [], throttlesize [5000], gridfs [false], filter [null], 
db [news], collection [entries], script [null], indexing to [news]/[entries]
MongoDB version - 3.0.2
update_mapping [mongodb] (dynamic)
[org.elasticsearch.river.mongodb.CollectionSlurper] Cannot ..
  import collection entries into existing index
d with mongodb - INITIAL_IMPORT_FAILED
Started river mongodb
no river _meta document found after 5 attempts
no river _meta document found after 5 attempts

Any suggestions to what might be wrong? I'm running ES 1.5.2 and MongoDB 3.0.2 on OS X.


Solution

  • On the mongodb river github pages, it looks like the plugin is supported up until version 1.4.2, but not higher (i.e. you're running 1.5.2)

    Also note that rivers have been deprecated in ES v1.5 and there's an open issue in the mongodb river project on this very topic.

    UPDATE after chatting with @martins

    Finally, the issue was simply that the name of the created river was wrong (i.e. news instead of mongodb), the following command would properly create the mongodb river, which still works with ES 1.5.2 even though not it's officially tested.

    curl -XPUT 'http://localhost:9200/_river/mongodb/_meta' -d @init.json