A product search index goes read-only at 11 PM during a promotional push. Indexing jobs start failing, the search bar returns partial results, and the cluster health API reports red. Nothing was deployed that evening. A single data node crossed 95% disk usage, and Elasticsearch did exactly what it is designed to do: it stopped writes to protect the data already on disk.
Elasticsearch cluster health is not a vague warning light. Green, yellow, and red are precise statements about shard availability, and each one maps to a specific set of causes you can diagnose with three API calls. This guide covers what each status means, what breaks while you sit in a degraded state, the diagnostic order that finds root cause fastest, the five causes behind most unassigned shards, and the cluster design choices that stop the problem from returning.
What Green, Yellow, and Red Mean in Elasticsearch Cluster Health?
Cluster status is derived from shard state alone. It reports the worst status across all indices, so one broken index turns the whole cluster red.
| Status | Shard state | Data risk | What still works |
|---|---|---|---|
| Green | All primary and all replica shards assigned | None | Search and indexing, with full redundancy |
| Yellow | All primaries assigned, one or more replicas unassigned | Data is complete, but there is no second copy | Search and indexing continue at full correctness |
| Red | At least one primary shard unassigned | Part of the data set is unavailable right now | Unaffected indices work normally |
Two points that are commonly misread:
Yellow does not mean data loss. Every document is present and searchable. What you have lost is redundancy and read throughput.
Red does not mean the cluster is down. Indices whose primaries are all assigned continue to serve traffic. Queries touching the affected index return partial results by default, because partial search results are allowed unless you explicitly turn that setting off. That default is why red states often surface as “wrong search results” tickets rather than outright errors.
A single node development cluster running index templates with one replica sits in yellow permanently. That is expected behaviour, not an incident, because Elasticsearch never places a replica on the same node as its primary.
Why Yellow and Red Both Need a Response, in Different Time Frames
| Degraded state | Immediate operational impact | What it escalates into |
|---|---|---|
| Yellow | Search load concentrates on primary shards, raising CPU and heap pressure on fewer nodes | One more node failure takes primaries offline, moving the cluster straight to red |
| Red | Writes to the affected index fail, and searches return incomplete result sets | Retrying ingestion pipelines back up, queue depth grows, and recovery competes with live traffic for I/O |
The 4-Step Diagnostic Workflow to Turn Red and Yellow Lights Back to Green
Run these in order. Steps 1 and 2 tell you the scope, step 3 tells you the cause, and only then do you change anything.
Cluster health, then identify unassigned shards, then allocation explain, then apply the specific fix.
Step 1: Establish scope with the Cluster Health API
Call the cluster health endpoint at index level and read the status, data node count, unassigned shard count, and active shard percentage. A node count below what you expect points to a node failure. A full node count alongside unassigned shards points to an allocation rule or a disk threshold.
Step 2: Locate the exact shards and read the reason code
Use the cat shards API with the index, shard, primary or replica flag, state, node, and unassigned reason columns. The unassigned reason narrows the investigation before you dig further.
| Reason code | What it usually indicates |
|---|---|
| Node left | A node holding that shard dropped out of the cluster |
| Allocation failed | Allocation was attempted and failed, often on corruption or mapping errors |
| Replica added | A replica was requested that the cluster has nowhere to place |
| Cluster recovered | Normal state during a full cluster restart, and it should clear on its own |
| Primary failed | The primary failed after being assigned, which is a red signal |
Step 3: Ask Elasticsearch why it will not allocate the shard
Call the cluster allocation explain API with the index name, shard number, and whether it is the primary. This is the step most teams skip. The response names the decider that blocked allocation and gives the reason per node, which is the difference between guessing and knowing. Pair it with the cat allocation API to see shard count, disk used percentage, and available disk per node.
Step 4: Apply the matching fix, then clear failed attempts
After you resolve the underlying condition, allocation does not always restart on its own. Elasticsearch stops retrying once the maximum allocation retries limit is reached, which defaults to five attempts. Clearing that counter takes a cluster reroute call with retry failed enabled.
Fixing the 5 Most Common Triggers of Yellow and Red Cluster Warnings
| Cause | Status | Signal in allocation explain | Fix |
|---|---|---|---|
| Replica count exceeds available data nodes | Yellow | A copy of this shard is already on the node, so no valid target remains | Reduce the number of replicas, or add data nodes. Correct the index template so new indices do not repeat it |
| Disk watermark breached | Yellow or Red | The node is above the high or flood stage watermark | Delete or roll off expired indices through ILM, add storage, or scale nodes. Raise watermarks only as a temporary measure |
| Data node left the cluster | Red if it held primaries | Node left, with node count below expected | Recover the node and let shards reallocate. If the node is unrecoverable, restore the index from the latest snapshot |
| Shard allocation disabled during maintenance | Yellow or Red | Cluster level allocation is set to none, or to primaries only | Reset cluster routing allocation back to all. Rolling restart runbooks should always include this step |
| Corrupt shard or repeated allocation failure | Red | Allocation failed, with retries exhausted | Retry once with retry failed enabled. If it fails again, restore from snapshot. Forcing an empty primary discards the shard’s data and is a last resort only |
Two further causes are worth checking when allocation explain points at a filtering decider: index level allocation filters left over from a data tier migration, and shard allocation awareness rules that cannot be satisfied because a zone or rack has no capacity.
Version upgrades are another common source of allocation trouble, so any Elasticsearch 7.x to 8.x upgrade should be rehearsed on a staging cluster with a tested recovery plan.
Disk Usage & Watermarks: What Trips the Cluster Warning Lights?
| Watermark | Default threshold | Elasticsearch behaviour |
|---|---|---|
| Low | 85% used | Stops allocating new shards to that node |
| High | 90% used | Starts relocating shards away from that node |
| Flood stage | 95% used | Applies a read-only block to every index with shards on that node |
Recent versions also apply maximum headroom caps so very large disks do not need an impractical amount of free space, and the flood stage write block is released automatically once usage falls back below the high watermark.
If you override the percentages, set the matching headroom values too, because the built-in headroom defaults stop applying once you set explicit thresholds.
Cluster Design Choices That Keep Your Status Light Solid Green
- Run three master eligible nodes: From Elasticsearch 7.0 onward, quorum-based voting replaced manual minimum master node configuration, and three master eligible nodes give the cluster a working quorum through the loss of any one of them.
- Separate node roles: Dedicated master, data, ingest, and coordinating roles keep cluster state work off the nodes doing heavy indexing.
- Size shards deliberately: Target roughly 10 GB to 50 GB per shard, and keep total shard count in line with heap. Elastic’s guidance is 20 shards or fewer per GB of heap on each node. Oversharding is the most common root cause behind recurring yellow states and slow cluster state updates.
- Cap heap at half of RAM and below the 32 GB compressed pointer boundary: Larger heaps lose that optimisation and lengthen garbage collection pauses.
- Automate retention with ILM and SLM: Index Lifecycle Management moves data through hot, warm, cold, frozen, and delete phases, and Snapshot Lifecycle Management keeps restorable copies. A snapshot you have never test-restored is not a recovery plan.
- Alert before the threshold, not on it: Track disk usage against the low watermark, old generation garbage collection time per node, circuit breaker trips, and unassigned shard count. Every one of those gives a warning before a status change.
How Ksolves’ AI-First Elasticsearch Support Keeps Clusters Green
Ksolves resolves degraded cluster states faster and at a lower total cost of ownership than in-house firefighting, because triage is instrumented rather than improvised. Every Ksolves engineer uses AI as a daily working tool for parsing allocation explain output, correlating node logs with garbage collection and watermark events, and reviewing index templates and ILM policies before they reach production. The outcome for your cluster is a shorter path from alert to root cause and fewer repeat incidents after the fix.
What that looks like in an engagement:
| Area | What Ksolves delivers |
|---|---|
| Incident response | SLA backed critical severity acknowledgement in 30 minutes with a 2 hour resolution target, contractually defined across Standard, Advanced, and Platinum plans |
| Monitoring | Prometheus exporter and Grafana dashboards covering green to yellow to red transitions, heap, garbage collection time, shard count, and watermark proximity |
| Health checks | Written audit of cluster topology, shard sizing, JVM configuration, mapping health, and ILM effectiveness, with severity ranked findings |
| Performance tuning | Shard count reduction, index consolidation using the Shrink API, ILM rollover redesign, heap resizing, and query optimisation |
| Security | TLS for transport and HTTP traffic, role based access control with least privilege, field and document level security, and audit logging with SIEM export |
Ksolves holds 99.99% SLA maintenance across managed client environments, has delivered over 150,000 support hours, and operates under ISO 27001, SOC 2 Type II, GDPR, HIPAA, and CMMI standards. Full scope is on the Elasticsearch support services page, and cluster hardening is covered in more depth in Data Security in Elasticsearch.
Conclusion
Yellow and red are diagnostic signals with a short list of causes. Read the health API for scope, read allocation explain for cause, fix the underlying condition, then clear the retry counter. The clusters that stay green are the ones where shard sizing, replica counts, heap, and retention were decided at design time rather than during an incident.
If your cluster is degraded right now, or the same status change keeps returning every few weeks, talk to the Ksolves Elasticsearch team about a health check.
Frequently Asked Questions
Will Elasticsearch lose data when the cluster status turns red?
A red Elasticsearch cluster status does not mean data is lost, but it does mean at least one primary shard is unassigned and that slice of data is unavailable until the shard is recovered. Data is permanently lost only if the node holding the shard cannot be recovered and no snapshot exists, or if you force an empty primary allocation. Restoring from a tested snapshot is the safe route.
How do I restart shard allocation after fixing the cause of an unassigned shard?
After you fix the underlying condition, run a cluster reroute with retry_failed enabled to restart shard allocation in Elasticsearch. Elasticsearch stops retrying a failed shard after five attempts by default, so allocation can stay stuck even once the disk, node, or setting problem is resolved. Run the allocation explain API again afterwards to confirm the shard is assigned.
Why did my Elasticsearch indices turn read-only when a node filled up?
Elasticsearch applies a read-only block to every index with a shard on a node once that node passes the flood stage disk watermark, which is 95% used by default. The block protects data already on disk, and recent versions release it automatically after usage drops below the high watermark. Free space with ILM retention, added storage, or more nodes rather than only raising the thresholds.
Should I raise disk watermark settings to get out of a red status?
Raising Elasticsearch disk watermarks is a short-term workaround, not a fix. It buys time for relocation or cleanup, but the node still runs out of room, and explicit percentage overrides also need matching headroom values because the built-in headroom defaults stop applying. Use it to stabilise the cluster, then delete expired indices, add storage, or scale nodes.
How many replicas can an Elasticsearch index have before the cluster turns yellow?
An Elasticsearch index can have at most one fewer replica than the number of data nodes, because a replica is never placed on the same node as its primary. One replica needs at least two data nodes, and two replicas need at least three. Ksolves health checks review index templates and replica settings so new indices do not recreate the yellow state.
Who can fix recurring Elasticsearch cluster health problems for me?
Ksolves provides Elasticsearch support and consulting for teams whose clusters keep drifting into yellow or red. Engagements cover shard allocation, ILM redesign, heap tuning, and written health checks, with SLA-backed incident response that includes a 30-minute acknowledgement for critical severity.
Still have questions about your cluster? Contact our team.
![]()
5 MIN READ