Elasticsearch:_count给出了奇怪的结果

时间:2013-04-24 15:15:10

标签: elasticsearch

$ curl -XGET'http://test.server.es:9200/index/test/_count?pretty'

{
  "count" : 229594,
  "_shards" : {
    "total" : 5,
    "successful" : 5,
    "failed" : 0
  }
}

再试一次:

$ curl -XGET'http://test.server.es:9200/index/test/_count?pretty'

{
  "count" : 226967,
  "_shards" : {
    "total" : 5,
    "successful" : 5,
    "failed" : 0
  }
}

“count”值小于之前的_count,但两个_count之间没有删除操作。

1 个答案:

答案 0 :(得分:1)

你的一个节点发疯了,并且上面有不完整的分片。

询问统计数据并找到故障节点:

curl -XGET 'http://localhost:9200/_cluster/nodes/stats'

如果您将副本设置为至少1,则只需停止此节点,删除数据目录并重新启动节点。

我的2美分