Elasticsearch查询阶段失败,所有分片都报错怎么办?
摘要:Elasticsearch 启动报错: [2023-05-19T22:39:32,161][DEBUG][o.e.a.s.TransportSearchAction] [X-111.ecs] All shards failed for ph
Elasticsearch 启动报错:
[2023-05-19T22:39:32,161][DEBUG][o.e.a.s.TransportSearchAction] [X-111.ecs] All shards failed for phase: [query]
[2020-05-19T22:39:32,162][WARN ][r.suppressed ] [X-111.ecs] path: /.kibana_task_manager/_search, params: {ignore_unavailable=true, index=.kibana_task_manager}
org.elasticsearch.action.search.SearchPhaseExecutionException: all shards failed
at org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseFailure(AbstractSearchAsyncAction.java:305) ~[elasticsearch-8.7.0.jar:8.7.0]
at org.elasticsearch.action.search.AbstractSearchAsyncAction.executeNextPhase(AbstractSearchAsyncAction.java:139) ~[elasticsearch-8.7.0.jar:8.7.0]
1、查看索引信息
curl -XGET 'http://localhost:9200/_cluster/health?pretty=true'
{
"cluster_name" : "elasticsearch",
"status" : "yellow",
"timed_out" : false,
"number_of_nodes" : 1,
"number_of_data_nodes" : 1,
"active_primary_shards" : 14,
"active_shards" : 14,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 4,
"delayed_unassigned_shards" : 0,
"number_of_pending_tasks" : 0,
"number_of_in_flight_fetch" : 0,
"task_max_waiting_in_queue_millis" : 0,
"active_shards_percent_as_number" : 77.77777777777779
}
2、查看状态
curl 'localhost:9200/_cat/indices?v'
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
yellow open logstash-nginx-access-log-2023.05.06 yJLiEgQqQEa9aBxoy1Ge9A 1 1 13704 0 3.6mb 3.6mb
yellow open logstash-nginx-error-log-2023.05.07 Kc13mo7NSIiFKyu6ABGS6w 1 1 603 0 491kb 491kb
yellow open logstash-nginx-error-log-2023.05.06 UJjcWNgkR3uiJi0ynxu51Q 1 1 491 0 374.1kb 374.1kb
yellow open logstash-nginx-access-log-2023.05.07 WjZi_913Qv-HSYzhy-qOGA 1 1 13784 0 3.2mb 3.2mb
green:所有的主分片和副本分片都已分配。
