All shards failed – Elasticsearch Error How To Solve Related Issues


All shards failed – Elasticsearch Error How To Solve Related Issues

Opster Team

July-20, Version: 1.7-8.0

 

Before you begin reading this guide, we recommend you try running 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 Check-Up can analyze your ES deployment to pinpoint the cause of shards failure and provides suitable actionable recommendations how to resolve (free tool that requires no installation).

Read bellow common problems on shards and search that may cause shards failure.

Log Context

Log”all shards failed”classname  is SearchScrollAsyncAction.java We extracted the following from Elasticsearch source code for those seeking an in-depth context :

addShardFailure(new ShardSearchFailure(failure; searchShardTarget));
  int successfulOperations = successfulOps.decrementAndGet();
  assert successfulOperations >= 0 : "successfulOperations must be >= 0 but was: " + successfulOperations;
  if (counter.countDown()) {
  if (successfulOps.get() == 0) {
  listener.onFailure(new SearchPhaseExecutionException(phaseName; "all shards failed"; failure; buildShardFailures()));
  } else {
  SearchPhase phase = nextPhaseSupplier.get();
  try {
  phase.run();
  } catch (Exception e) {

 

Optimize Elasticsearch Performance

Try The Tool