0

I used this tutorial to install and configure MongoDB / Elasticsearch.

The whole tutorial worked on Mac OSX Yosemite and now I tried to do the same on Ubuntu 14.04.

Here is my ElasticSearch log:

[2014-12-08 15:49:13,733][INFO ][cluster.service          ] [Western Kid] new_master [Western Kid][fo8GLpDoRyKYBAkjk7f-jw][my_hostname][inet[localhost/127.0.0.1:9300]], reason: zen-disco-join (elected_as_master)
[2014-12-08 15:49:13,758][INFO ][http                     ] [Western Kid] bound_address {inet[/127.0.0.1:9200]}, publish_address {inet[localhost/127.0.0.1:9200]}
[2014-12-08 15:49:13,758][INFO ][node                     ] [Western Kid] started
[2014-12-08 15:49:14,449][INFO ][gateway                  ] [Western Kid] recovered [1] indices into cluster_state
[2014-12-08 15:49:15,225][INFO ][org.elasticsearch.river.mongodb.MongoDBRiver] Starting river mongodb
[2014-12-08 15:49:15,230][INFO ][org.elasticsearch.river.mongodb.MongoDBRiver] MongoDB River Plugin - version[2.0.4] - hash[7472875] - time[2014-11-11T13:26:19Z]
[2014-12-08 15:49:15,231][INFO ][org.elasticsearch.river.mongodb.MongoDBRiver] starting mongodb stream. options: secondaryreadpreference [false], drop_collection [false], include_collection [], throttlesize [5000], gridfs [false], filter [null], db [my_db_name], collection [my_collection], script [null], indexing to [my_index]/[my_type]
[2014-12-08 15:49:15,231][INFO ][river.mongodb.util       ] setRiverStatus called with mongodb - RUNNING
[2014-12-08 15:57:56,543][INFO ][cluster.metadata         ] [Western Kid] [_river] update_mapping [my_db_name] (dynamic)

When I tried to start indexing my collection, I got the following message:

{
  "_index": "_river",
  "_type": "my_type",
  "_id": "_meta",
  "_version": 4,
  "created": false
}

The version is increasing every time I try and started with 1.

I guess, created:false means, the index could not be created for some reason but I have no idea why.

Saeed Zhiany
  • 2,051
  • 9
  • 30
  • 41
mr.proton
  • 993
  • 2
  • 10
  • 24

1 Answers1

0

The version of the river is increasing because you are actually updating the _river index so Elasticsearch is not creating it since it's already there.

You might want to install elasticsearch-head plugin to visualize your cluster better since you don't seem to be very familiar with the API.

Try to delete the _river and create it again and you'll see that this time it will actually have the status created.

eliasah
  • 39,588
  • 11
  • 124
  • 154
  • Then why is it not possible to query the index? curl -XGET 'http://localhost:9200/fwindex/_search?q=searchFor:Value' {"error":"IndexMissingException[[my_index] missing]","status":404} – mr.proton Dec 08 '14 at 17:04
  • The _river index and the index you are trying to search on are two separate things. Usually, you need to create your index that the river will write data on! this curl command is trying to search data on 'fwindex' and if you haven't created it, you wont be able to query it or write on it! – eliasah Dec 09 '14 at 07:10
  • If you read the linked Tutorial, you will see that the guy is doing the same. He is creating the index via curl -XPUT 'http://localhost:9200/_river/mongodb/_meta' -d ... and then querying the index via curl -XGET 'http://localhost:9200/mongoindex/_search?q=firstName:John'. As I said, I followed the tutorial on Mac OS X and it's working fine. I have no idea whats wrong with my Ubuntu system. – mr.proton Dec 09 '14 at 08:19
  • Instead of telling what the tutorial says, have you even tried anything from what I told you at least? – eliasah Dec 09 '14 at 08:51
  • Yes, i deleted the _river and recreated it: {"_index":"_river","_type":"my_database","_id":"_meta","_version":1,"created":true}. The log says: [2014-12-09 09:24:49,089][INFO ][cluster.metadata ] [Ymir] [_river] update_mapping [my_database] (dynamic). But I still cannot query the index via curl -XGET localhost:9200/my_index/_search/. It then says {"error":"IndexMissingException[[my_index] missing]","status":404} – mr.proton Dec 09 '14 at 09:27
  • and did you create the index before running the river again? step 1. create the index you want the river to run on. step 2. add the river step 3. check the logs to see how it's indexing. – eliasah Dec 09 '14 at 09:49