简体   繁体   中英

How to create an index with ElasticSearch, River and MongoDB?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM