Elasticsearch: Cluster Status is RED

[post-views]
January 03, 2025 · 1 min read
Elasticsearch: Cluster Status is RED

It happens very rarely, but sometimes your cluster gets red status.

Red status means that not only has the primary shard been lost but also that the replica has not been upgraded to primary in its place.

However, as in the case of yellow status, you should not panic and start firing commands without finding out what is happening, as Elasticsearch has mechanisms that can restore the situation automatically.

1: Find the cause of the allocation failure:

GET _cluster/allocation/explain

The API returns: “unassigned_info” (reason for the shard being unassigned), “node_allocation_decision” (list of explanations for each node’s eligibility to receive the shard), and “deciders” (decision with its explanation).

2. Retry Elasticsearch shard allocation blocked by multiple consecutive allocation failures:

POST /_cluster/reroute?retry_failed=true

3. The CAT pending tasks operation displays the progress of all pending tasks, including their priority and time in the queue, as shown in the following example request:

GET /_cat/pending_tasks?v

Was this article helpful?

Like and share it with your peers.
Join SOC Prime's Detection as Code platform to improve visibility into threats most relevant to your business. To help you get started and drive immediate value, book a meeting now with SOC Prime experts.

Related Posts