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. 1.Check cluster health:
  2. 2.```bash
  3. 3.curl -X GET "localhost:9200/_cluster/health?pretty"
  4. 4.curl -X GET "localhost:9200/_cluster/allocation/explain?pretty"
  5. 5.`
  6. 6.Check for disk watermark issues:
  7. 7.```bash
  8. 8.curl -X GET "localhost:9200/_cat/allocation?v"
  9. 9.curl -X GET "localhost:9200/_cluster/settings?include_defaults=true&filter_path=**.disk.watermark"
  10. 10.`
  11. 11.Force allocation if needed:
  12. 12.```bash
  13. 13.curl -X POST "localhost:9200/_cluster/reroute" -H 'Content-Type: application/json' -d'
  14. 14.{
  15. 15."commands": [
  16. 16.{
  17. 17."allocate_replica": {
  18. 18."index": "my-index",
  19. 19."shard": 0,
  20. 20."node": "node-1"
  21. 21.}
  22. 22.}
  23. 23.]
  24. 24.}'
  25. 25.`