# Cluster state is yellow due to unassigned shrads

**URL:** <https://discuss.elastic.co/t/cluster-state-is-yellow-due-to-unassigned-shrads/230462>\
**Category:** Elasticsearch\
**Created:** [April 30, 2020, 5:34am UTC](https://discuss.elastic.co/t/cluster-state-is-yellow-due-to-unassigned-shrads/230462 "2020-04-30T05:34:46Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![DENMODSupport](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/denmodsupport/32/67186_2.png) [@DENMODSupport](https://discuss.elastic.co/u/DENMODSupport)\
**Post date:** [April 30, 2020, 5:34am UTC](https://discuss.elastic.co/t/cluster-state-is-yellow-due-to-unassigned-shrads/230462/1 "2020-04-30T05:34:46Z")

</div>

Since there are 207 unassigned shrads, my cluster status became yellow. I ran the API "\_cluster/allocation/explain" and got below results.  
{  
"index": "en\_y\_29",  
"shard": 1,  
"primary": false,  
"current\_state": "unassigned",  
"unassigned\_info": {  
"reason": "CLUSTER\_RECOVERED",  
"at": "2020-03-31T12:10:04.627Z",  
"last\_allocation\_status": "no\_attempt"  
},  
"can\_allocate": "no",  
"allocate\_explanation": "cannot allocate because allocation is not permitted to any of the nodes",  
"node\_allocation\_decisions": [  
{  
"node\_id": "BD6tAWxMQwGUf6rab6DBIg",  
"node\_name": "elk-denmod-1",  
"transport\_address": "168.124.183.229:9300",  
"node\_decision": "no",  
"deciders": [  
{  
"decider": "same\_shard",  
"decision": "NO",  
"explanation": "the shard cannot be allocated to the same node on which a copy of the shard already exists [[en\_y\_29][1], node[BD6tAWxMQwGUf6rab6DBIg], [P], s[STARTED], a[id=YdGSMhPKROS0x1hiZEhJ5w]]"  
}  
]  
}  
]  
}

is it because that we didn't select any value for setting "cluster.routing.allication.enable"? what should i do now to allocate all the unassined shrads now?

---

<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:** [April 30, 2020, 5:43am UTC](https://discuss.elastic.co/t/cluster-state-is-yellow-due-to-unassigned-shrads/230462/2 "2020-04-30T05:43:44Z")

</div>

How many data nodes do you have in the cluster?

---

<div class="post-metadata">

**Author:** ![DENMODSupport](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/denmodsupport/32/67186_2.png) [@DENMODSupport](https://discuss.elastic.co/u/DENMODSupport)\
**Post date:** [April 30, 2020, 9:44am UTC](https://discuss.elastic.co/t/cluster-state-is-yellow-due-to-unassigned-shrads/230462/3 "2020-04-30T09:44:24Z")

</div>

i have only one data node.

---

<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:** [April 30, 2020, 11:28am UTC](https://discuss.elastic.co/t/cluster-state-is-yellow-due-to-unassigned-shrads/230462/4 "2020-04-30T11:28:58Z")

</div>

Replicas can never be allocated to the same node as the primary so what you are seeing is expected and not a problem. You can get them green by setting the number of replicas to 0 for all indices.

---

<div class="post-metadata">

**Author:** ![DENMODSupport](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/denmodsupport/32/67186_2.png) [@DENMODSupport](https://discuss.elastic.co/u/DENMODSupport)\
**Post date:** [April 30, 2020, 1:42pm UTC](https://discuss.elastic.co/t/cluster-state-is-yellow-due-to-unassigned-shrads/230462/5 "2020-04-30T13:42:57Z")

</div>

If the other nodes are master nodes, can we allocate the replica shrads in that master node?

---

<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:** [April 30, 2020, 1:51pm UTC](https://discuss.elastic.co/t/cluster-state-is-yellow-due-to-unassigned-shrads/230462/6 "2020-04-30T13:51:34Z")

</div>

No, only data nodes can hold data although nodes can be both master and data nodes at the same time.

---

<div class="post-metadata">

**Author:** ![DENMODSupport](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/denmodsupport/32/67186_2.png) [@DENMODSupport](https://discuss.elastic.co/u/DENMODSupport)\
**Post date:** [April 30, 2020, 1:53pm UTC](https://discuss.elastic.co/t/cluster-state-is-yellow-due-to-unassigned-shrads/230462/7 "2020-04-30T13:53:01Z")

</div>

We have two master nodes in our cluster. if we change the one of the master nodes as both master and data node, will it allocate the replica shrads in that node automatically?

---

<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:** [April 30, 2020, 1:54pm UTC](https://discuss.elastic.co/t/cluster-state-is-yellow-due-to-unassigned-shrads/230462/8 "2020-04-30T13:54:14Z")

</div>

You should always have at least 3master eligible nodes in any cluster. 2 is not a good number.

---

<div class="post-metadata">

**Author:** ![DENMODSupport](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/denmodsupport/32/67186_2.png) [@DENMODSupport](https://discuss.elastic.co/u/DENMODSupport)\
**Post date:** [April 30, 2020, 1:57pm UTC](https://discuss.elastic.co/t/cluster-state-is-yellow-due-to-unassigned-shrads/230462/9 "2020-04-30T13:57:07Z")

</div>

We have only three nodes in our cluster. can we make all three as master and two node as data node?

---

<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:** [April 30, 2020, 2:04pm UTC](https://discuss.elastic.co/t/cluster-state-is-yellow-due-to-unassigned-shrads/230462/10 "2020-04-30T14:04:34Z")

</div>

If they are the same spec I would make them all master/data.

---

<div class="post-metadata">

**Author:** ![DENMODSupport](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/denmodsupport/32/67186_2.png) [@DENMODSupport](https://discuss.elastic.co/u/DENMODSupport)\
**Post date:** [April 30, 2020, 2:15pm UTC](https://discuss.elastic.co/t/cluster-state-is-yellow-due-to-unassigned-shrads/230462/11 "2020-04-30T14:15:44Z")

</div>

you mean hardware specification? if i change all the nodes as master/data, will the replica shrads allocate automatically or do i need to allocate it manually?

---

<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:** [April 30, 2020, 3:40pm UTC](https://discuss.elastic.co/t/cluster-state-is-yellow-due-to-unassigned-shrads/230462/12 "2020-04-30T15:40:10Z")

</div>

If will allocate automatically.

---

<div class="post-metadata">

**Author:** ![DENMODSupport](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/denmodsupport/32/67186_2.png) [@DENMODSupport](https://discuss.elastic.co/u/DENMODSupport)\
**Post date:** [April 30, 2020, 4:03pm UTC](https://discuss.elastic.co/t/cluster-state-is-yellow-due-to-unassigned-shrads/230462/13 "2020-04-30T16:03:36Z")

</div>

> [@Cluster state is yellow due to unassigned shrads](https://discuss.elastic.co/t/cluster-state-is-yellow-due-to-unassigned-shrads/230462/10):
>
> If they are the same spec I would make them all master/data.

Do you mean hardware specification in the above reply should be same for all the three nodes? Once i changed all the nodes as both master\data, do i need to restart the Elasticsearch service? or should i stop the service before making changes?

---

<div class="post-metadata">

**Author:** ![DENMODSupport](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/denmodsupport/32/67186_2.png) [@DENMODSupport](https://discuss.elastic.co/u/DENMODSupport)\
**Post date:** [May 4, 2020, 8:43am UTC](https://discuss.elastic.co/t/cluster-state-is-yellow-due-to-unassigned-shrads/230462/14 "2020-05-04T08:43:35Z")

</div>

Please provide an update on this.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 4, 2020, 9:43am UTC](https://discuss.elastic.co/t/cluster-state-is-yellow-due-to-unassigned-shrads/230462/15 "2020-05-04T09:43:36Z")

</div>

> [@DENMODSupport](#):
>
> do i need to restart the Elasticsearch service?

Yes.

---

<div class="post-metadata">

**Author:** ![DENMODSupport](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/denmodsupport/32/67186_2.png) [@DENMODSupport](https://discuss.elastic.co/u/DENMODSupport)\
**Post date:** [May 6, 2020, 1:08pm UTC](https://discuss.elastic.co/t/cluster-state-is-yellow-due-to-unassigned-shrads/230462/16 "2020-05-06T13:08:37Z")

</div>

> [@Cluster state is yellow due to unassigned shrads](https://discuss.elastic.co/t/cluster-state-is-yellow-due-to-unassigned-shrads/230462/10):
>
> If they are the same spec I would make them all master/data.

Could you please confirm whether you are referring hardware specification here?

---

<div class="post-metadata">

**Author:** ![DENMODSupport](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/denmodsupport/32/67186_2.png) [@DENMODSupport](https://discuss.elastic.co/u/DENMODSupport)\
**Post date:** [May 7, 2020, 4:58am UTC](https://discuss.elastic.co/t/cluster-state-is-yellow-due-to-unassigned-shrads/230462/17 "2020-05-07T04:58:25Z")

</div>

Please provide an update on this.

---

<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:** [May 7, 2020, 5:10am UTC](https://discuss.elastic.co/t/cluster-state-is-yellow-due-to-unassigned-shrads/230462/18 "2020-05-07T05:10:30Z")

</div>

Yes, I was referring to hardware specification. Elasticsearch assumes all nodes are equal.

---

<div class="post-metadata">

**Author:** ![DENMODSupport](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/denmodsupport/32/67186_2.png) [@DENMODSupport](https://discuss.elastic.co/u/DENMODSupport)\
**Post date:** [May 7, 2020, 5:12am UTC](https://discuss.elastic.co/t/cluster-state-is-yellow-due-to-unassigned-shrads/230462/19 "2020-05-07T05:12:31Z")

</div>

What is the procedure to make all the three nodes as master\data nodes? what are all the things need to keep in mind while changing the roles?

---

<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:** [June 4, 2020, 5:12am UTC](https://discuss.elastic.co/t/cluster-state-is-yellow-due-to-unassigned-shrads/230462/20 "2020-06-04T05:12:38Z")

</div>

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