Troubleshooting guide
Elasticsearch cluster status red: how to fix it
Red means at least one primary shard is unassigned, so some data is not searchable. The allocation explain API tells you why.
3 min read10 sectionsUpdated
On this page
# Health, and which indices are red
curl -s localhost:9200/_cluster/health?pretty
curl -s 'localhost:9200/_cat/indices?v&health=red'
# Unassigned shards and reasons
curl -s 'localhost:9200/_cat/shards?v&h=index,shard,prirep,state,unassigned.reason' | grep UNASSIGNED
# The full explanation
curl -s localhost:9200/_cluster/allocation/explain?pretty
# Disk per node
curl -s 'localhost:9200/_cat/allocation?v'Fixes
Bring lost nodes back first, because data on them may return intact. Free disk space by removing old indices, then clear a read-only block:
PUT */_settings {"index.blocks.read_only_allow_delete": null}
Retry allocations that hit their retry limit with POST _cluster/reroute?retry_failed=true. Restore from a snapshot when data is really gone. allocate_empty_primary makes the index usable but discards the shard's data, so it should be your last choice.
Prevent the next one
Always keep at least one replica for indices you care about, and spread replicas across zones through allocation awareness. Avoid too many small shards, as each one uses heap: a rule of thumb is shards sized between 10 and 50 GB. Use index lifecycle management to roll over and delete old data automatically, so disk growth does not rely on someone remembering. Finally, take snapshots to object storage and practise restoring them, because a backup you have never restored is only a hope.
Catch it automatically
Alert on red immediately and on yellow when it lasts. Track disk per node, heap and JVM GC with Elasticsearch monitoring. A disk alert at 75 percent gives you time before the watermarks start moving shards.
Is yellow a problem?
It means replicas are unassigned. Data is available, but with no redundancy. A single-node cluster is always yellow when replicas are configured.
Why did my index become read-only?
A node passed the flood-stage disk watermark.
Can I recover a red index without backups?
Only if a copy of the shard exists on some node.
Related reading
- Kubernetes node NotReady: how to diagnose and fix it: Fix a Kubernetes node stuck in NotReady: kubelet failures, memory or disk pressure, CNI problems and runtime crashes, with commands for node conditions.
- ERR_ADDRESS_UNREACHABLE: how to fix it: Fix ERR_ADDRESS_UNREACHABLE: no route to the server, wrong IP in DNS, IPv6 problems, private addresses and firewalls, for visitors and server owners.
- ERR_INTERNET_DISCONNECTED: how to fix it: Fix ERR_INTERNET_DISCONNECTED in Chrome: reconnect Wi-Fi, check the router, disable proxies and VPNs, reset network settings, and when apps say offline.
- A Atlassian Statuspage alternative: VitalRix vs Atlassian Statuspage: VitalRix vs Atlassian Statuspage: hosted status pages compared, plus components that update from real monitors, incidents, on-call and SLAs.
- Cloudflare error 1016 "Origin DNS error": how to fix it: Fix Cloudflare error 1016 Origin DNS error: CNAME records pointing to names that do not resolve, deleted origins and load balancer pools, with checks.
- DNS_PROBE_FINISHED_NO_INTERNET: how to fix it: Fix DNS_PROBE_FINISHED_NO_INTERNET in Chrome: check the connection, restart the router, flush DNS, reset network settings and switch DNS servers.
Watch your own site and services with VitalRix
Uptime checks, APM, logs, real-user monitoring, alerts and status pages in one place. Every product has a free tier and no credit card is needed.