# Cluster in Yellow due to replica not assigned

**URL:** https://discuss.elastic.co/t/cluster-in-yellow-due-to-replica-not-assigned/145822
**Category:** Elasticsearch
**Created:** [August 24, 2018, 12:34am UTC](https://discuss.elastic.co/t/cluster-in-yellow-due-to-replica-not-assigned/145822 "2018-08-24T00:34:05Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![newlearner](https://avatars.discourse-cdn.com/v4/letter/n/ee59a6/32.png) [@newlearner](https://discuss.elastic.co/u/newlearner)
#### Post date: [August 24, 2018, 12:34am UTC](https://discuss.elastic.co/t/cluster-in-yellow-due-to-replica-not-assigned/145822/1 "2018-08-24T00:34:06Z")

</div>

Hi team

I have .watches replica in UNASSIGNED state due to which my cluster in showing Yellow

.watches 0 p STARTED  
.watches 0 r UNASSIGNED

I restarted the cluster, updated the replica not nothing working. I also tried to delete but that too not working.

Please let me know how to fix this?

---

<div class="post-metadata">

### Author: ![Ethan-Zhang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ethan-zhang/32/54812_2.png) [@Ethan-Zhang](https://discuss.elastic.co/u/Ethan-Zhang)
#### Post date: [August 24, 2018, 1:59am UTC](https://discuss.elastic.co/t/cluster-in-yellow-due-to-replica-not-assigned/145822/2 "2018-08-24T01:59:05Z")

</div>

Please confirm you replica num equals you node num, or there will be shards unassigned.

---

<div class="post-metadata">

### Author: ![newlearner](https://avatars.discourse-cdn.com/v4/letter/n/ee59a6/32.png) [@newlearner](https://discuss.elastic.co/u/newlearner)
#### Post date: [August 24, 2018, 3:29am UTC](https://discuss.elastic.co/t/cluster-in-yellow-due-to-replica-not-assigned/145822/3 "2018-08-24T03:29:53Z")

</div>

How to find that?

---

<div class="post-metadata">

### Author: ![newlearner](https://avatars.discourse-cdn.com/v4/letter/n/ee59a6/32.png) [@newlearner](https://discuss.elastic.co/u/newlearner)
#### Post date: [August 24, 2018, 3:31am UTC](https://discuss.elastic.co/t/cluster-in-yellow-due-to-replica-not-assigned/145822/4 "2018-08-24T03:31:05Z")

</div>

{  
"cluster\_name": "test",  
"status": "yellow",  
"timed\_out": false,  
"number\_of\_nodes": 4,  
"number\_of\_data\_nodes": 3,  
"active\_primary\_shards": 1,  
"active\_shards": 1,  
"relocating\_shards": 0,  
"initializing\_shards": 0,  
"unassigned\_shards": 1,  
"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": 98.7012987012987  
}

---

<div class="post-metadata">

### Author: ![Ethan-Zhang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ethan-zhang/32/54812_2.png) [@Ethan-Zhang](https://discuss.elastic.co/u/Ethan-Zhang)
#### Post date: [August 24, 2018, 3:40am UTC](https://discuss.elastic.co/t/cluster-in-yellow-due-to-replica-not-assigned/145822/5 "2018-08-24T03:40:15Z")

</div>

> [@newlearner](#):
>
> number\_of\_data\_nodes

`GET _nodes/stats` to see how many data node you have. And `GET _cat/shards` to check how many replica of .watches.

---

<div class="post-metadata">

### Author: ![newlearner](https://avatars.discourse-cdn.com/v4/letter/n/ee59a6/32.png) [@newlearner](https://discuss.elastic.co/u/newlearner)
#### Post date: [August 24, 2018, 4:34am UTC](https://discuss.elastic.co/t/cluster-in-yellow-due-to-replica-not-assigned/145822/6 "2018-08-24T04:34:34Z")

</div>

Hi Ethan,

following are the info

ip heap.percent ram.percent cpu load\_1m load\_5m load\_15m node.role master name  
x.x.201.157 65 57 5 0.12 0.13 0.15 mdi \* k01  
x.x.72.39 47 89 5 0.08 0.11 0.04 - - b01  
x.x.75.23 41 69 39 0.07 0.10 0.09 mdi - b03  
x.x.75.24 29 70 59 1.28 0.29 0.09 mdi - b04

.watches

.watches 0 p STARTED 6 83.5kb x.x.75.23 b03  
.watches 0 r UNASSIGNED

{  
"cluster\_name": "test",  
"status": "yellow",  
"timed\_out": false,  
"number\_of\_nodes": 4,  
"number\_of\_data\_nodes": 3,  
"active\_primary\_shards": 1,  
"active\_shards": 1,  
"relocating\_shards": 0,  
"initializing\_shards": 0,  
"unassigned\_shards": 1,  
"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": 98.7012987012987  
}

---

<div class="post-metadata">

### Author: ![Ethan-Zhang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ethan-zhang/32/54812_2.png) [@Ethan-Zhang](https://discuss.elastic.co/u/Ethan-Zhang)
#### Post date: [August 24, 2018, 6:16am UTC](https://discuss.elastic.co/t/cluster-in-yellow-due-to-replica-not-assigned/145822/7 "2018-08-24T06:16:44Z")

</div>

> [@newlearner](#):
>
> .watches 0 p STARTED 6 83.5kb x.x.75.23 b03

`GET /_cluster/allocation/explain?pretty` to see why the replica shard is unassigned.

---

<div class="post-metadata">

### Author: ![newlearner](https://avatars.discourse-cdn.com/v4/letter/n/ee59a6/32.png) [@newlearner](https://discuss.elastic.co/u/newlearner)
#### Post date: [August 24, 2018, 7:23am UTC](https://discuss.elastic.co/t/cluster-in-yellow-due-to-replica-not-assigned/145822/8 "2018-08-24T07:23:30Z")

</div>

{  
"index": ".watches",  
"shard": 0,  
"primary": false,  
"current\_state": "unassigned",  
"unassigned\_info": {  
"reason": "REPLICA\_ADDED",  
"at": "2018-08-24T04:27:24.515Z",  
"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": "27PGffnYSWuGtsqrBxS9Uw",  
"node\_name": "b04",  
"transport\_address": "x.x.75.24:9300",  
"node\_attributes": {  
"ml.machine\_memory": "16725929984",  
"ml.max\_open\_jobs": "20",  
"xpack.installed": "true",  
"ml.enabled": "true"  
},  
"node\_decision": "no",  
"deciders": [  
{  
"decider": "filter",  
"decision": "NO",  
"explanation": """node does not match index setting [index.routing.allocation.include] filters [role:"watcher"]"""  
}  
]  
},  
{  
"node\_id": "jIsi4SI\_SQiccMQ698ylUw",  
"node\_name": "K04",  
"transport\_address": "x.x.201.157:9300",  
"node\_attributes": {  
"ml.machine\_memory": "12491837440",  
"ml.max\_open\_jobs": "20",  
"xpack.installed": "true",  
"ml.enabled": "true"  
},  
"node\_decision": "no",  
"deciders": [  
{  
"decider": "filter",  
"decision": "NO",  
"explanation": """node does not match index setting [index.routing.allocation.include] filters [role:"watcher"]"""  
}  
]  
},  
{  
"node\_id": "vLEamAVtR3CmX-2F0UszZg",  
"node\_name": "b03",  
"transport\_address": "x.x.75.23:9300",  
"node\_attributes": {  
"ml.machine\_memory": "16725929984",  
"ml.max\_open\_jobs": "20",  
"xpack.installed": "true",  
"ml.enabled": "true"  
},  
"node\_decision": "no",  
"deciders": [  
{  
"decider": "filter",  
"decision": "NO",  
"explanation": """node does not match index setting [index.routing.allocation.include] filters [role:"watcher"]"""  
},  
{  
"decider": "same\_shard",  
"decision": "NO",  
"explanation": "the shard cannot be allocated to the same node on which a copy of the shard already exists [[.watches][0], node[vLEamAVtR3CmX-2F0UszZg], [P], s[STARTED], a[id=hBga4WUvRfKmzroDzTH\_rA]]"  
}  
]  
}  
]  
}

---

<div class="post-metadata">

### Author: ![Ethan-Zhang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ethan-zhang/32/54812_2.png) [@Ethan-Zhang](https://discuss.elastic.co/u/Ethan-Zhang)
#### Post date: [August 24, 2018, 7:26am UTC](https://discuss.elastic.co/t/cluster-in-yellow-due-to-replica-not-assigned/145822/9 "2018-08-24T07:26:28Z")

</div>

> [@newlearner](#):
>
> "explanation": """node does not match index setting [index.routing.allocation.include] filters [role:"watcher"]"""

Here is the reason `"explanation": """node does not match index setting [index.routing.allocation.include] filters [role:"watcher"]"""`

---

<div class="post-metadata">

### Author: ![newlearner](https://avatars.discourse-cdn.com/v4/letter/n/ee59a6/32.png) [@newlearner](https://discuss.elastic.co/u/newlearner)
#### Post date: [August 24, 2018, 7:26am UTC](https://discuss.elastic.co/t/cluster-in-yellow-due-to-replica-not-assigned/145822/10 "2018-08-24T07:26:52Z")

</div>

> [@Ethan-Zhang](#):
>
> index.routing.allocation.include

how and what to do?

---

<div class="post-metadata">

### Author: ![Ethan-Zhang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ethan-zhang/32/54812_2.png) [@Ethan-Zhang](https://discuss.elastic.co/u/Ethan-Zhang)
#### Post date: [August 24, 2018, 7:29am UTC](https://discuss.elastic.co/t/cluster-in-yellow-due-to-replica-not-assigned/145822/11 "2018-08-24T07:29:18Z")

</div>

`GET .watches/_settings` to see if there is [index.routing.allocation.include] settings.

---

<div class="post-metadata">

### Author: ![newlearner](https://avatars.discourse-cdn.com/v4/letter/n/ee59a6/32.png) [@newlearner](https://discuss.elastic.co/u/newlearner)
#### Post date: [August 24, 2018, 7:31am UTC](https://discuss.elastic.co/t/cluster-in-yellow-due-to-replica-not-assigned/145822/12 "2018-08-24T07:31:15Z")

</div>

> [@Ethan-Zhang](#):
>
> GET .watches/\_settings

{  
".watches": {  
"settings": {  
"index": {  
"routing": {  
"allocation": {  
"include": {  
"size": "big,medium",  
"role": "watcher"  
}  
}  
},  
"number\_of\_shards": "1",  
"auto\_expand\_replicas": "0-1",  
"provided\_name": ".watches",  
"format": "6",  
"creation\_date": "1534905070718",  
"priority": "800",  
"number\_of\_replicas": "1",  
"uuid": "P4L3soP2TcqedB2yEuDtaw",  
"version": {  
"created": "6030299"  
}  
}  
}  
}  
}

---

<div class="post-metadata">

### Author: ![newlearner](https://avatars.discourse-cdn.com/v4/letter/n/ee59a6/32.png) [@newlearner](https://discuss.elastic.co/u/newlearner)
#### Post date: [August 24, 2018, 7:31am UTC](https://discuss.elastic.co/t/cluster-in-yellow-due-to-replica-not-assigned/145822/13 "2018-08-24T07:31:48Z")

</div>

I update with  
PUT .watches/\_settings  
{  
"index.routing.allocation.include.size": "big,medium"  
}

---

<div class="post-metadata">

### Author: ![newlearner](https://avatars.discourse-cdn.com/v4/letter/n/ee59a6/32.png) [@newlearner](https://discuss.elastic.co/u/newlearner)
#### Post date: [August 24, 2018, 7:33am UTC](https://discuss.elastic.co/t/cluster-in-yellow-due-to-replica-not-assigned/145822/14 "2018-08-24T07:33:01Z")

</div>

Still its watches 0 r UNASSIGNED

---

<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 24, 2018, 7:35am UTC](https://discuss.elastic.co/t/cluster-in-yellow-due-to-replica-not-assigned/145822/15 "2018-08-24T07:35:48Z")

</div>

What is the output of the [cat nodeattrs API](https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-nodeattrs.html)?

---

<div class="post-metadata">

### Author: ![newlearner](https://avatars.discourse-cdn.com/v4/letter/n/ee59a6/32.png) [@newlearner](https://discuss.elastic.co/u/newlearner)
#### Post date: [August 24, 2018, 7:41am UTC](https://discuss.elastic.co/t/cluster-in-yellow-due-to-replica-not-assigned/145822/16 "2018-08-24T07:41:03Z")

</div>

K04 x.x.201.157 x.x.201.157 ml.machine\_memory 12491837440  
K04 x.x.201.157 x.x.201.157 ml.max\_open\_jobs 20  
K04 x.x.201.157 x.x.201.157 xpack.installed true  
K04 x.x.201.157 x.x.201.157 ml.enabled true  
b01 x.x.72.39 x.x.72.39 ml.machine\_memory 16725929984  
b01 x.x.72.39 x.x.72.39 ml.max\_open\_jobs 20  
b01 x.x.72.39 x.x.72.39 xpack.installed true  
b01 x.x.72.39 x.x.72.39 ml.enabled true  
b03 x.x.75.23 x.x.75.23 ml.machine\_memory 16725929984  
b03 x.x.75.23 x.x.75.23 ml.max\_open\_jobs 20  
b03 x.x.75.23 x.x.75.23 xpack.installed true  
b03 x.x.75.23 x.x.75.23 ml.enabled true  
b04 x.x.75.24 x.x.75.24 ml.machine\_memory 16725929984  
b04 x.x.75.24 x.x.75.24 ml.max\_open\_jobs 20  
b04 x.x.75.24 x.x.75.24 xpack.installed true  
b04 x.x.75.24 x.x.75.24 ml.enabled true

---

<div class="post-metadata">

### Author: ![Ethan-Zhang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ethan-zhang/32/54812_2.png) [@Ethan-Zhang](https://discuss.elastic.co/u/Ethan-Zhang)
#### Post date: [August 24, 2018, 7:42am UTC](https://discuss.elastic.co/t/cluster-in-yellow-due-to-replica-not-assigned/145822/17 "2018-08-24T07:42:21Z")

</div>

> [@newlearner](#):
>
> routing

delete the routing setting if you don't need it.

---

<div class="post-metadata">

### Author: ![newlearner](https://avatars.discourse-cdn.com/v4/letter/n/ee59a6/32.png) [@newlearner](https://discuss.elastic.co/u/newlearner)
#### Post date: [August 24, 2018, 7:43am UTC](https://discuss.elastic.co/t/cluster-in-yellow-due-to-replica-not-assigned/145822/18 "2018-08-24T07:43:43Z")

</div>

I run it to see it fixs

---

<div class="post-metadata">

### Author: ![newlearner](https://avatars.discourse-cdn.com/v4/letter/n/ee59a6/32.png) [@newlearner](https://discuss.elastic.co/u/newlearner)
#### Post date: [August 24, 2018, 7:46am UTC](https://discuss.elastic.co/t/cluster-in-yellow-due-to-replica-not-assigned/145822/19 "2018-08-24T07:46:28Z")

</div>

Whats next?

---

<div class="post-metadata">

### Author: ![newlearner](https://avatars.discourse-cdn.com/v4/letter/n/ee59a6/32.png) [@newlearner](https://discuss.elastic.co/u/newlearner)
#### Post date: [August 24, 2018, 7:55am UTC](https://discuss.elastic.co/t/cluster-in-yellow-due-to-replica-not-assigned/145822/20 "2018-08-24T07:55:23Z")

</div>

I tried to delete but getting the below error

{  
"error": "This endpoint is not supported for DELETE on .watches index.",  
"status": 400  
}

[Next page](https://discuss.elastic.co/t/cluster-in-yellow-due-to-replica-not-assigned/145822.md?page=2)
