SearchPhaseExecutionException [无法执行阶段[查询],所有分片都失败]

时间:2015-05-06 10:12:39

标签: elasticsearch logstash windows-server-2012 kibana

最近我们的服务器重新启动而没有正确关闭Elastic Search / Kibana。重启后,两个应用程序都在运行,但不再创建任何索引。我在调试模式下检查了logstash设置,它正在向Elastic Search发送数据。

现在我创建的所有窗口都会报告此错误:

Oops! SearchPhaseExecutionException[Failed to execute phase [query], all shards failed]

我尝试重启Elastic Search / Kibana,并清除了一些索引。我搜索了很多,但无法正确解决这个问题。

当前群集运行状况状态为红色,如图所示。

Elastic Search Cluster Health

任何有关如何排除故障的帮助都会被提升。谢谢

编辑:

[2015-05-06 00:00:01,561][WARN ][cluster.action.shard     ] [Indech] [logstash-2015.03.16][1] sending failed shard for [logstash-2015.03.16][1], node[fdSgUPDbQB2B3NQqX7MdMQ], [P], s[INITIALIZING], indexUUID [aBcfbqnNR4-AGEdIR8dVdg], reason [Failed to start shard, message [IndexShardGatewayRecoveryException[[logstash-2015.03.16][1] failed to recover shard]; nested: ElasticsearchIllegalArgumentException[No version type match [101]]; ]]
[2015-05-06 00:00:01,561][WARN ][cluster.action.shard     ] [Indech] [logstash-2015.03.16][1] received shard failed for [logstash-2015.03.16][1], node[fdSgUPDbQB2B3NQqX7MdMQ], [P], s[INITIALIZING], indexUUID [aBcfbqnNR4-AGEdIR8dVdg], reason [Failed to start shard, message [IndexShardGatewayRecoveryException[[logstash-2015.03.16][1] failed to recover shard]; nested: ElasticsearchIllegalArgumentException[No version type match [101]]; ]]
[2015-05-06 00:00:02,591][WARN ][indices.cluster          ] [Indech] [logstash-2015.04.21][4] failed to start shard
org.elasticsearch.index.gateway.IndexShardGatewayRecoveryException: [logstash-2015.04.21][4] failed to recover shard
    at org.elasticsearch.index.gateway.local.LocalIndexShardGateway.recover(LocalIndexShardGateway.java:269)
    at org.elasticsearch.index.gateway.IndexShardGatewayService$1.run(IndexShardGatewayService.java:132)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
Caused by: org.elasticsearch.ElasticsearchIllegalArgumentException: No version type match [52]
    at org.elasticsearch.index.VersionType.fromValue(VersionType.java:307)
    at org.elasticsearch.index.translog.Translog$Create.readFrom(Translog.java:364)
    at org.elasticsearch.index.translog.TranslogStreams.readTranslogOperation(TranslogStreams.java:52)
    at org.elasticsearch.index.gateway.local.LocalIndexShardGateway.recover(LocalIndexShardGateway.java:241)

对象中我关注的是:

[2015-05-06 15:13:48,059][DEBUG][action.search.type       ] All shards failed for phase: [query]



{
  "cluster_name" : "elasticsearch",
  "status" : "red",
  "timed_out" : false,
  "number_of_nodes" : 8,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 120,
  "active_shards" : 120,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 310
}

1 个答案:

答案 0 :(得分:11)

您有许多损坏的translog文件,您需要删除它们。您可以在data/{clustername}/nodes/0/indices/logstash-2015.04.21/4/translog中找到它,在data/{clustername}/nodes/0/indices/logstash-2015.03.16/1/translog中找到另一个。也许还有其他人,但这是我从你提供的代码片段中可以看到的。当然,会丢失translog文件中的内容。

如果索引不再具有索引文件(_state下只存在data/{clustername}/nodes/0/indices/[index_name]文件夹),则表示该索引中不再有数据,此时您可以删除指数。如果仍然需要,您需要重新索引该数据。如果您决定删除索引,则需要关闭节点并删除data/{clustername}/nodes/0/indices下与您提到的索引文件夹类似的索引文件夹(空,仅包含_state文件夹)。