Introduction
A yellow cluster status indicates unassigned replica shards. This guide explains shard allocation and how to return to green status.
Symptoms
- Cluster health shows yellow
- Unassigned shards in cluster allocation explain
- Some indices showing yellow status
Step-by-Step Fix
- 1.Check cluster health:
- 2.```bash
- 3.curl -X GET "localhost:9200/_cluster/health?pretty"
- 4.curl -X GET "localhost:9200/_cluster/allocation/explain?pretty"
- 5.
` - 6.Check for disk watermark issues:
- 7.```bash
- 8.curl -X GET "localhost:9200/_cat/allocation?v"
- 9.curl -X GET "localhost:9200/_cluster/settings?include_defaults=true&filter_path=**.disk.watermark"
- 10.
` - 11.Force allocation if needed:
- 12.```bash
- 13.curl -X POST "localhost:9200/_cluster/reroute" -H 'Content-Type: application/json' -d'
- 14.{
- 15."commands": [
- 16.{
- 17."allocate_replica": {
- 18."index": "my-index",
- 19."shard": 0,
- 20."node": "node-1"
- 21.}
- 22.}
- 23.]
- 24.}'
- 25.
`