# How can I fix yellow state cluster?

**URL:** <https://discuss.elastic.co/t/how-can-i-fix-yellow-state-cluster/196644>\
**Category:** Elasticsearch\
**Created:** [August 25, 2019, 5:03am UTC](https://discuss.elastic.co/t/how-can-i-fix-yellow-state-cluster/196644 "2019-08-25T05:03:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hurryup](https://avatars.discourse-cdn.com/v4/letter/h/aeb1de/32.png) [@hurryup](https://discuss.elastic.co/u/hurryup)\
**Post date:** [August 25, 2019, 5:03am UTC](https://discuss.elastic.co/t/how-can-i-fix-yellow-state-cluster/196644/1 "2019-08-25T05:03:45Z")

</div>

Hello.

I have to reboot one of my 3 node cluster node and now one index is in the yellow state .

```
curl -XGET localhost:9200/_cluster/health/my_index | jq '.'
{
  "cluster_name": "cl1",
  "status": "yellow",
  "timed_out": false,
  "number_of_nodes": 3,
  "number_of_data_nodes": 3,
  "active_primary_shards": 5,
  "active_shards": 8,
  "relocating_shards": 0,
  "initializing_shards": 0,
  "unassigned_shards": 2,
  "delayed_unassigned_shards": 0,
  "number_of_pending_tasks": 0,
  "number_of_in_flight_fetch": 0,
  "task_max_waiting_in_queue_millis": 0,
  "active_shards_percent_as_number": 96.7741935483871
}

```

What does it mean "active\_shards\_percent\_as\_number": 96.7741935483871 ?

And how can I get green state ?

---

<div class="post-metadata">

**Author:** ![hurryup](https://avatars.discourse-cdn.com/v4/letter/h/aeb1de/32.png) [@hurryup](https://discuss.elastic.co/u/hurryup)\
**Post date:** [August 25, 2019, 5:07am UTC](https://discuss.elastic.co/t/how-can-i-fix-yellow-state-cluster/196644/2 "2019-08-25T05:07:29Z")

</div>

```
{
 "cluster_name": "cl1",
 "status": "yellow",
 "timed_out": false,
 "number_of_nodes": 3,
 "number_of_data_nodes": 3,
 "active_primary_shards": 5,
 "active_shards": 8,
 "relocating_shards": 0,
 "initializing_shards": 0,
 "unassigned_shards": 2,
 "delayed_unassigned_shards": 0,
 "number_of_pending_tasks": 0,
 "number_of_in_flight_fetch": 0,
 "task_max_waiting_in_queue_millis": 0,
 "active_shards_percent_as_number": 96.7741935483871,
 "indices": {
   "my_index": {
     "status": "yellow",
     "number_of_shards": 5,
     "number_of_replicas": 1,
     "active_primary_shards": 5,
     "active_shards": 8,
     "relocating_shards": 0,
     "initializing_shards": 0,
     "unassigned_shards": 2,
     "shards": {
       "0": {
         "status": "green",
         "primary_active": true,
         "active_shards": 2,
         "relocating_shards": 0,
         "initializing_shards": 0,
         "unassigned_shards": 0
       },
       "1": {
         "status": "green",
         "primary_active": true,
         "active_shards": 2,
         "relocating_shards": 0,
         "initializing_shards": 0,
         "unassigned_shards": 0
       },
       "2": {
         "status": "green",
         "primary_active": true,
         "active_shards": 2,
         "relocating_shards": 0,
         "initializing_shards": 0,
         "unassigned_shards": 0
       },
       "3": {
         "status": "yellow",
         "primary_active": true,
         "active_shards": 1,
         "relocating_shards": 0,
         "initializing_shards": 0,
         "unassigned_shards": 1
       },
       "4": {
         "status": "yellow",
         "primary_active": true,
         "active_shards": 1,
         "relocating_shards": 0,
         "initializing_shards": 0,
         "unassigned_shards": 1
       }
     }
   }
 }
}
```

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [August 25, 2019, 5:13am UTC](https://discuss.elastic.co/t/how-can-i-fix-yellow-state-cluster/196644/3 "2019-08-25T05:13:57Z")

</div>

As long as all your nodes are using exactly the same version of Elasticsearch and there is enough space on disk this should fix itself. You can use the [cluster allocation explain API](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/cluster-allocation-explain.html) to find out why the missing shards are not assigned.

---

<div class="post-metadata">

**Author:** ![hurryup](https://avatars.discourse-cdn.com/v4/letter/h/aeb1de/32.png) [@hurryup](https://discuss.elastic.co/u/hurryup)\
**Post date:** [August 25, 2019, 5:16am UTC](https://discuss.elastic.co/t/how-can-i-fix-yellow-state-cluster/196644/4 "2019-08-25T05:16:18Z")

</div>

Yes. Thanks.  
Fixed by curl -XPOST localhost:9200/\_cluster/reroute?retry\_failed=true

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 22, 2019, 5:16am UTC](https://discuss.elastic.co/t/how-can-i-fix-yellow-state-cluster/196644/5 "2019-09-22T05:16:22Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
