SearchPhaseExecutionException [无法执行phase [query],所有分片失败] [英] SearchPhaseExecutionException[Failed to execute phase [query], all shards failed]

查看:27123
本文介绍了SearchPhaseExecutionException [无法执行phase [query],所有分片失败]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



现在我创建的窗口都报告了这个错误:

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

我尝试重新启动弹性搜索/ Kibana并清理了一些指标。我搜索了很多,但无法正确解决这个问题。



当前群集健康状态为RED,如图所示。





有关如何排除故障的任何帮助都是upvoted。谢谢



编辑:

  [2015-05-06 00发送失败的分片[logstash-2015.03.16] [1],节点[fdSgUPDbQB2B3NQqX7MdMQ],[P] ],s [INITIALIZING],indexUUID [aBcfbqnNR4-AGEdIR8dVdg],原因[无法启动分片,消息[IndexShardGatewayRecoveryException [[logstash-2015.03.16] [1]无法恢复碎片];嵌套:ElasticsearchIllegalArgumentException [无版本类型匹配[101]]; ]] 
[2015-05-06 00:00:01,561] [WARN] [cluster.action.shard] [Indech] [logstash-2015.03.16] [1]收到的分片失败[logstash-2015.03] 16] [1],节点[fdSgUPDbQB2B3NQqX7MdMQ],[P],s [INITIALIZING],indexUUID [aBcfbqnNR4-AGEdIR8dVdg],原因[无法启动分片,消息[IndexShardGatewayRecoveryException [[logstash-2015.03.16] [1]恢复碎片];嵌套:ElasticsearchIllegalArgumentException [无版本类型匹配[101]]; ]]
[2015-05-06 00:00:02,591] [WARN] [indices.cluster] [Indech] [logstash-2015.04.21] [4]未能启动shard
org.elasticsearch .index.gateway.IndexShardGatewayRecoveryException:[logstash-2015.04.21] [4]无法在org.elasticsearch.index.gateway.local.LocalIndexShardGateway.recover(LocalIndexShardGateway.java:269)中恢复碎片

在org.elasticsearch.index.gateway.IndexShardGatewayService $ 1.run(IndexShardGatewayService.java:132)
在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
在java.util。 concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:615)
在java.lang.Thread.run(Thread.java:744)
引起的:org.elasticsearch.ElasticsearchIllegalArgumentException:没有版本类型匹配$ 52 $ org.elasticsearch.index.VersionType.fromValue(VersionType.java:307)
b $ b在org.elasticsear ch.index.translog.TranslogStreams.readTranslogOperation(TranslogStreams.java:52)
在org.elasticsearch.index.gateway.local.LocalIndexShardGateway.recover(LocalIndexShardGateway.java:241)

在论文中我关心的是:

  [2015-05-06 15:13:48,059] [DEBUG] [action.search.type]所有分片在阶段失败:[查询] 



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


解决方案

损坏的translog文件,您需要删除。您可以在 data / {clustername} /nodes/0/indices/logstash-2015.04.21/4/translog 中找到它,另一个在数据中/{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 文件夹)。


Recently our server was rebooted without correctly shutting down the Elastic Search / Kibana. After that reboot, both applications were running but no indices were getting created anymore. I checked logstash setup in debug mode and it is sending data to Elastic Search.

now all my created windows report this error:

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

I tried restarting Elastic Search / Kibana, and cleared some indices. I searched a lot but wasn't able to troubleshoot this correctly.

Current Cluster Health Status is RED as shown in picture.

Any help as of how to troubleshoot that is upvoted. Thank you

EDIT:

[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)

what concerns me in the logsis this:

[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
}

解决方案

You have many corrupt translog files, which you need to delete. You can find it in data/{clustername}/nodes/0/indices/logstash-2015.04.21/4/translog and another one in data/{clustername}/nodes/0/indices/logstash-2015.03.16/1/translog. And maybe others, but this is what I can tell from the snippet you provided. Of course, will loose what is in the translog files.

If the indices don't have the index files anymore (only _state folder exists under data/{clustername}/nodes/0/indices/[index_name]) this means there is no data in that index anymore and at this point you can delete the index. You need to reindex that data, if you still need it. If you decide to delete the indices, you need to shutdown the node and delete the index folders under data/{clustername}/nodes/0/indices that are like the one you mentioned (empty, containing just the _state folder).

这篇关于SearchPhaseExecutionException [无法执行phase [query],所有分片失败]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆