【问题标题】:Elasticsearch and MongoDB: no river _meta document found after 5 attemptsElasticsearch 和 MongoDB:尝试 5 次后未找到河流 _meta 文档
【发布时间】:2015-07-27 08:39:18
【问题描述】:

我有一个名为 news 的 MongoDB 数据库,我尝试使用 ES 对其进行索引。 使用这些插件:

richardwilly98.elasticsearch/elasticsearch-river-mongodb/2.0.9elasticsearch/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.2MongoDB 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


【解决方案1】:

the mongodb river github pages 上,该插件似乎在 1.4.2 版本之前都受支持,但不是更高版本(即您运行的是 1.5.2)

另请注意,河流在 ES v1.5 中已被弃用,并且在 mongodb River 项目中有一个 open issue 与此主题相关。

与@martins 聊天后更新

最后,问题只是创建的河流的名称错误(即news而不是mongodb),以下命令将正确创建mongodb河流,即使在ES 1.5.2中仍然可以使用没有经过官方测试。

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

【讨论】:

  • 问题指的是河流将被支持/保持到2,0
  • 是的,ES 将支持 Rivers 直到 2.0,但我的评论更多的是关于 mongodb 插件是否仍然支持它。现在,它似乎不适用于 ES 1.5.x。
  • 啊哈,我明白了。现在让 ES 和 MongoDB 成为朋友的当前解决方案是什么?
  • 试试用ES 1.4.2吧?
  • 是的,github.com/richardwilly98/… 的 testmongo 示例仍然有效。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-09-21
  • 1970-01-01
  • 2014-04-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多