# Cluster Health: Red, Unassigned Shards

**URL:** https://discuss.elastic.co/t/cluster-health-red-unassigned-shards/58469
**Category:** Elasticsearch
**Created:** [August 19, 2016, 2:29pm UTC](https://discuss.elastic.co/t/cluster-health-red-unassigned-shards/58469 "2016-08-19T14:29:12Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Tyler\_Siemers](https://avatars.discourse-cdn.com/v4/letter/t/ec9cab/32.png) [@Tyler\_Siemers](https://discuss.elastic.co/u/Tyler_Siemers)
#### Post date: [August 19, 2016, 2:29pm UTC](https://discuss.elastic.co/t/cluster-health-red-unassigned-shards/58469/1 "2016-08-19T14:29:12Z")

</div>

Here is my setup.

All servers are running "Ubuntu 14.04"

> n1 - 12gb ram, 2 cpu, 1tb - (x) master - ( ) data  
> n2 - 12gb ram, 2 cpu, 1tb - ( ) master - (x) data  
> n3 - 12gb ram, 2 cpu, 500gb - ( ) master - (x) data  
> n4 - 12gb ram, 2 cpu, 500gb - ( ) master - (x) data  
> Logstash/Kibana - 16gb ram, 8 cpu, 6tb

New to setting up a cluster compared to just a single test machine. After setting my cluster to have node 1 as the master and nodes 2,3,4 as master eligleble/data nodes. The cluster health went Yellow, tried restarting and it went to red.  
I am fairly certain it has to do with replicas not being set right. The guide I used said to set in elasticsearch.yml:

> index.number\_of\_replicas: 3

Where 3 was calculated by (# of nodes / 2 + 1)

Is this correct? When I do a cluster health I don't see any replicas at all.

> {  
> "cluster\_name" : "SASD",  
> "status" : "red",  
> "timed\_out" : false,  
> "number\_of\_nodes" : 4,  
> "number\_of\_data\_nodes" : 3,  
> "active\_primary\_shards" : 10,  
> "active\_shards" : 29,  
> "relocating\_shards" : 0,  
> "initializing\_shards" : 0,  
> "unassigned\_shards" : 13,  
> "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" : 69.04761904761905  
> }

My index is as follows:

> health status index pri rep docs.count docs.deleted store.size pri.store.size  
> green open .kibana 1 1 7 1 83.1kb 41.5kb  
> red open firesight-2016.08.19 5 3 145 0 1.6mb 574.7kb  
> yellow open firesight-2016.08.18 5 3 478 0 2mb 691.2kb

I have just one firewall sending syslog to Logstash that is creating a new index every day called firesight-{date}.

Question 1  
Now that I changed one to a master would this affect how many replicas I need, from what I read it shouldn't matter at all.

Question 2:  
Now that one node is set to master, do I only need to make configuration changes to that node? Will it get pushed to the other nodes, or if I need to change something in the elasticsearch.yml file do I need to do it on all nodes?

Thanks

---

<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 19, 2016, 2:38pm UTC](https://discuss.elastic.co/t/cluster-health-red-unassigned-shards/58469/2 "2016-08-19T14:38:19Z")

</div>

> [@Tyler\_Siemers](#):
>
> Where 3 was calculated by (# of nodes / 2 + 1)

It is usually the setting for `minimum_master_nodes` that is calculated this way. You should make sure this is set on all nodes in order to avoid split brain scenarios. There is no such required setting for number of replicas, as that typically varies depending on use case. If you only have 3 data nodes, you should set the number of replicas no higher than 2, as that will cause all nodes to hold a copy of each shard.

---

<div class="post-metadata">

### Author: ![Tyler\_Siemers](https://avatars.discourse-cdn.com/v4/letter/t/ec9cab/32.png) [@Tyler\_Siemers](https://discuss.elastic.co/u/Tyler_Siemers)
#### Post date: [August 19, 2016, 2:52pm UTC](https://discuss.elastic.co/t/cluster-health-red-unassigned-shards/58469/3 "2016-08-19T14:52:03Z")

</div>

Okay. Thanks for clarifying the setting. I have set **minimum\_master\_nodes** to **3** across all 4 nodes in the yml. file. It is still showing RED even after full reboot of all four nodes.

Shouldn't

> "number\_of\_replicas"

show when I do a cluster health?

---

<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: [August 19, 2016, 10:45pm UTC](https://discuss.elastic.co/t/cluster-health-red-unassigned-shards/58469/4 "2016-08-19T22:45:55Z")

</div>

No, cluster health doesn't report replicas at all.

Use the `_cat` API for that.

---

<div class="post-metadata">

### Author: ![Tyler\_Siemers](https://avatars.discourse-cdn.com/v4/letter/t/ec9cab/32.png) [@Tyler\_Siemers](https://discuss.elastic.co/u/Tyler_Siemers)
#### Post date: [August 22, 2016, 11:58am UTC](https://discuss.elastic.co/t/cluster-health-red-unassigned-shards/58469/5 "2016-08-22T11:58:50Z")

</div>

Thanks warkolm.

That API lead me to the root cause. During my initial startup somehow the first two days of indexing I had something screwed up that caused some shards to become unassigned.

> firesight-2016.08.19 0 r UNASSIGNED

after deleting the two indexes that contained "unassigned" shards everything went back to Green.

Thanks again.

---

<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: [August 22, 2016, 10:36pm UTC](https://discuss.elastic.co/t/cluster-health-red-unassigned-shards/58469/6 "2016-08-22T22:36:12Z")

</div>

You could have just removed the replicas 🙂

---

<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 5, 2017, 10:26pm UTC](https://discuss.elastic.co/t/cluster-health-red-unassigned-shards/58469/7 "2017-07-05T22:26:01Z")

</div>


