【发布时间】:2015-07-27 08:39:18
【问题描述】:
我有一个名为 news 的 MongoDB 数据库,我尝试使用 ES 对其进行索引。
使用这些插件:
richardwilly98.elasticsearch/elasticsearch-river-mongodb/2.0.9 和 elasticsearch/elasticsearch-mapper-attachments/2.5.0
这就是我尝试创建索引时发生的情况。我试图删除索引并重新创建它,但没有帮助。
$ 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"
}
}
这是日志
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
对可能出现的问题有什么建议吗? 我在 OS X 上运行 ES 1.5.2 和 MongoDB 3.0.2。
【问题讨论】:
-
运行
curl -XGET localhost:9200/_river/news/_search时看到了什么? -
{ "took" : 1, "timed_out" : false, "_shards" : { "total" : 1, "successful" : 1, "failed" : 0 }, "hits" : { “total”:0,“max_score”:null,“hits”:[]}}
-
好的,由于您的卷曲,没有存储任何内容。你能用
--data-binary @init.json代替-d @init.json试试吗 -
试过
curl -XDELETE localhost:9200/_river/mongodb => {"acknowledged":true}%。还有curl -XPUT 'http://localhost:9200/_river/mongodb/_meta' --data-binary @init.json => {"_index":"_river","_type":"mongodb","_id":"_meta","_version":1,"created":true}% -
现在的结果是: { "took" : 1, "timed_out" : false, "_shards" : { "total" : 1, "successful" : 1, "failed" : 0 }, “命中”:{“总数”:0,“最大得分”:空,“命中”:[]}}
标签: mongodb elasticsearch elasticsearch-plugin