0

我成功设置了弹性搜索 mongodb。我正在使用 Elastic search 版本 1.3.5 和 River 版本 2.0.2。

当我试图获得河流的状态时

curl -XGET "localhost:9200/_river/mongodb/_meta"

我收到以下错误

{"success":false,"error":"action not found: /_river/mongodb/_meta"}

我的河名是“mongodb”

我也试过 _status 请求

curl -XGET "http://localhost:9200/_river/mongodb/_status"
{"success":false,"error":"action not found: /_river/mongodb/_status"}
4

2 回答 2

0

请求应使用“_status”而不是“_meta”:

 curl -XGET "localhost:9200/_river/mongodb/_status"

请参阅River 文档

于 2014-12-16T13:53:28.707 回答
0

我得到了答案,实际上问题是由于河流名称mongodb。我将名称更改为test_river。之后_status,请求起作用_meta了。_riverstatus

当我使用河流名称mongodb时,我能够获得所有其他请求的正确响应,例如搜索、河流创建的索引的状态等。

curl -XGET "localhost:9200/_river/test_river/_status"

结果:

{
  "_index": "_river",
  "_type": "test_river",
  "_id": "_status",
  "_version": 1,
  "found": true,
  "_source": {
    "node": "",
    "id": "pw3UUP7KQcuVSocDLlFdQw",
    "name": "Starshine",
    "transport_address": "inet[/10.3.0.53:9300]"
  }
}

curl -XGET "localhost:9200/_river/test_river/_meta"

结果:

{
  "_index": "_river",
  "_type": "test_river",
  "_id": "_meta",
  "_version": 1,
  "found": true,
  "_source": {
    "type": "mongodb",
    "mongodb": {
      "db": "test",
      "collection": "employees"
    },
    "index": {
      "name": "el_test",
      "type": "employees"
    }
  }
}

curl -XGET "localhost:9200/_river/test_river/_riverstatus

结果:

{
  "_index": "_river",
  "_type": "test_river",
  "_id": "_riverstatus",
  "_version": 3,
  "found": true,
  "_source": {
    "mongodb": {
      "status": "RUNNING"
    }
  }
}
于 2014-12-17T06:11:11.867 回答