0

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.

walen
  • 7,103
  • 2
  • 37
  • 58
martins
  • 9,669
  • 11
  • 57
  • 85
  • What do you see when running `curl -XGET localhost:9200/_river/news/_search` ? – Val May 15 '15 at 12:40
  • { "took" : 1, "timed_out" : false, "_shards" : { "total" : 1, "successful" : 1, "failed" : 0 }, "hits" : { "total" : 0, "max_score" : null, "hits" : [ ] } } – martins May 15 '15 at 14:18
  • Ok, nothing got stored as a result of your curl. Can you try with `--data-binary @init.json` instead of `-d @init.json` – Val May 15 '15 at 14:21
  • Tried `curl -XDELETE localhost:9200/_river/mongodb => {"acknowledged":true}%`. And `curl -XPUT 'http://localhost:9200/_river/mongodb/_meta' --data-binary @init.json => {"_index":"_river","_type":"mongodb","_id":"_meta","_version":1,"created":true}%` – martins May 15 '15 at 14:28
  • The result now is: { "took" : 1, "timed_out" : false, "_shards" : { "total" : 1, "successful" : 1, "failed" : 0 }, "hits" : { "total" : 0, "max_score" : null, "hits" : [ ] } } – martins May 15 '15 at 14:29
  • then the type should be `mongodb` not `news` => `curl -XGET localhost:9200/_river/mongodb/_search` – Val May 15 '15 at 14:32
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/77908/discussion-between-val-and-martins). – Val May 15 '15 at 14:37

1 Answers1

1

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
Val
  • 207,596
  • 13
  • 358
  • 360
  • the issue refer to says that the river will be supported / kept until 2,0 – martins May 15 '15 at 13:25
  • Yes, ES will support rivers until 2.0, but my comment was more about whether the mongodb plugin still supports it. Right now, it doesn't seem to work with ES 1.5.x. – Val May 15 '15 at 13:27
  • Aha, I see. What's the current solution for having ES and MongoDB being friends these days? – martins May 15 '15 at 14:26
  • Try to use ES 1.4.2 maybe? – Val May 15 '15 at 14:31
  • Yes, the testmongo example at https://github.com/richardwilly98/elasticsearch-river-mongodb#build-status still works. – martins May 15 '15 at 15:18