# Cluster health goes green to yellow

**URL:** https://discuss.elastic.co/t/cluster-health-goes-green-to-yellow/1300
**Category:** Elasticsearch
**Created:** [May 26, 2015, 10:30am UTC](https://discuss.elastic.co/t/cluster-health-goes-green-to-yellow/1300 "2015-05-26T10:30:26Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![mudgilgaurav](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mudgilgaurav/32/25163_2.png) [@mudgilgaurav](https://discuss.elastic.co/u/mudgilgaurav)
#### Post date: [May 26, 2015, 10:30am UTC](https://discuss.elastic.co/t/cluster-health-goes-green-to-yellow/1300/1 "2015-05-26T10:30:26Z")

</div>

my cluster state was green and after restart of service one shard remains UNASSIGNED and status goes to yellow. I have 2 machines with 5 shard and 1 replica set settings. I am using default config with multicast off and uni cast enabled.On both machines I left master/data settings unchanged so by default both can switch to master and save data. And on both machines i set 5 shards and 1 replica set and on unicase i gave [IP,IP:port]

I did rerouting using

for shard in $(curl -XGET [http://localhost:9201/\_cat/shards](http://localhost:9201/_cat/shards) | grep UNASSIGNED | awk '{print $2}'); do echo "processing $shard" curl -XPOST 'localhost:9201/\_cluster/reroute' -d '{ "commands" : [{ "allocate" : { "index" : "wall", "shard" : '$shard', "node" : "node1", "allow\_primary" : false } }] }' sleep 5 done

Which gives following output

{"acknowledged":true,"state":{"version":48,"master\_node":"Ar7UpWUQSpSlYcje-u6bgA","blocks":{},"nodes":{"EtQ9mOrLQbiUbHGqeQgMvQ":{"name":"node2","transport\_address":"inet[/XXX.XXX.XX.XXX:9300]","attributes":{}},"Ar7UpWUQSpSlYcje-u6bgA":{"name":"node1","transport\_address":"inet[/XXX.XXX.XX.XXX:9301]","attributes":{}}},"routing\_table":{"indices":{"wall":{"shards":{"2":[{"state":"STARTED","primary":false,"node":"EtQ9mOrLQbiUbHGqeQgMvQ","relocating\_node":null,"shard":2,"index":"wall"},{"state":"STARTED","primary":true,"node":"Ar7UpWUQSpSlYcje-u6bgA","relocating\_node":null,"shard":2,"index":"wall"}],"0":[{"state":"STARTED","primary":true,"node":"EtQ9mOrLQbiUbHGqeQgMvQ","relocating\_node":null,"shard":0,"index":"wall"},{"state":"INITIALIZING","primary":false,"node":"Ar7UpWUQSpSlYcje-u6bgA","relocating\_node":null,"shard":0,"index":"wall"}],"3":[{"state":"STARTED","primary":false,"node":"EtQ9mOrLQbiUbHGqeQgMvQ","relocating\_node":null,"shard":3,"index":"wall"},{"state":"STARTED","primary":true,"node":"Ar7UpWUQSpSlYcje-u6bgA","relocating\_node":null,"shard":3,"index":"wall"}],"1":[{"state":"STARTED","primary":false,"node":"EtQ9mOrLQbiUbHGqeQgMvQ","relocating\_node":null,"shard":1,"index":"wall"},{"state":"STARTED","primary":true,"node":"Ar7UpWUQSpSlYcje-u6bgA","relocating\_node":null,"shard":1,"index":"wall"}],"4":[{"state":"STARTED","primary":false,"node":"EtQ9mOrLQbiUbHGqeQgMvQ","relocating\_node":null,"shard":4,"index":"wall"},{"state":"STARTED","primary":true,"node":"Ar7UpWUQSpSlYcje-u6bgA","relocating\_node":null,"shard":4,"index":"wall"}]}}}},"routing\_nodes":{"unassigned":[],"nodes":{"EtQ9mOrLQbiUbHGqeQgMvQ":[{"state":"STARTED","primary":false,"node":"EtQ9mOrLQbiUbHGqeQgMvQ","relocating\_node":null,"shard":2,"index":"wall"},{"state":"STARTED","primary":true,"node":"EtQ9mOrLQbiUbHGqeQgMvQ","relocating\_node":null,"shard":0,"index":"wall"},{"state":"STARTED","primary":false,"node":"EtQ9mOrLQbiUbHGqeQgMvQ","relocating\_node":null,"shard":3,"index":"wall"},{"state":"STARTED","primary":false,"node":"EtQ9mOrLQbiUbHGqeQgMvQ","relocating\_node":null,"shard":1,"index":"wall"},{"state":"STARTED","primary":false,"node":"EtQ9mOrLQbiUbHGqeQgMvQ","relocating\_node":null,"shard":4,"index":"wall"}],"Ar7UpWUQSpSlYcje-u6bgA":[{"state":"STARTED","primary":true,"node":"Ar7UpWUQSpSlYcje-u6bgA","relocating\_node":null,"shard":2,"index":"wall"},{"state":"INITIALIZING","primary":false,"node":"Ar7UpWUQSpSlYcje-u6bgA","relocating\_node":null,"shard":0,"index":"wall"},{"state":"STARTED","primary":true,"node":"Ar7UpWUQSpSlYcje-u6bgA","relocating\_node":null,"shard":3,"index":"wall"},{"state":"STARTED","primary":true,"node":"Ar7UpWUQSpSlYcje-u6bgA","relocating\_node":null,"shard":1,"index":"wall"},{"state":"STARTED","primary":true,"node":"Ar7UpWUQSpSlYcje-u6bgA","relocating\_node":null,"shard":4,"index":"wall"}]}},"allocations":[]}}

But 0th shard is still unassigned and status is yellow.

Any help or suggestions would be greatly appreciated.

Thanks

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [May 27, 2015, 12:22am UTC](https://discuss.elastic.co/t/cluster-health-goes-green-to-yellow/1300/2 "2015-05-27T00:22:53Z")

</div>

The quick fix would be to drop replicas for that index and then add them back.

---

<div class="post-metadata">

### Author: ![Dong\_Hyun\_Kim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dong_hyun_kim/32/7069_2.png) [@Dong\_Hyun\_Kim](https://discuss.elastic.co/u/Dong_Hyun_Kim)
#### Post date: [May 27, 2015, 12:34am UTC](https://discuss.elastic.co/t/cluster-health-goes-green-to-yellow/1300/3 "2015-05-27T00:34:48Z")

</div>

Hello!  
I had similar unassigned shard problem last night.  
I use two virtual CentOS machine and one of them lost their disk as unmounted. that causes continually yellow or red index status. because free disk size is low and can't allocate shard or replica, everything.  
you may see this  
[https://www.elastic.co/guide/en/elasticsearch/reference/1.5/index-modules-allocation.html](https://www.elastic.co/guide/en/elasticsearch/reference/1.5/index-modules-allocation.html)

---

<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: [July 6, 2017, 12:11am UTC](https://discuss.elastic.co/t/cluster-health-goes-green-to-yellow/1300/4 "2017-07-06T00:11:46Z")

</div>


