I was working on elastic search and it was working perfectly. Today I just restarted my remote server (Ubuntu). Now I am searching in my indexes, it is giving me this error.
{"error":"SearchPhaseExecutionException[Failed to execute phase [query_fetch], all shards failed]","status":503}
I also checked the health. The status is red. Can anyone tell me what's the issue.
All Shards Failed – How to solve this Elasticsearch error. To understand why all shards failed, we recommend you run the Elasticsearch Error Check-Up which can resolve issues that cause many errors related to shards and help prevent this error from happening again.
The shard is the unit at which Elasticsearch distributes data around the cluster. The speed at which Elasticsearch can move shards around when rebalancing data, e.g. following a failure, will depend on the size and number of shards as well as network and disk performance.
Elasticsearch takes in unstructured data from different locations, stores and indexes it according to user-specified mapping (which can also be derived automatically from data), and makes it searchable. Its distributed architecture makes it possible to search and analyze huge volumes of data in near real time.
It is possible on your restart some shards were not recovered, causing the cluster to stay red.
If you hit:http://<yourhost>:9200/_cluster/health/?level=shards
you can look for red shards.
I have had issues on restart where shards end up in a non recoverable state. My solution was to simply delete that index completely. That is not an ideal solution for everyone.
It is also nice to visualize issues like this with a plugin like:
Elasticsearch Head
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With