# Confused about index health: active\_shards + unassigned\_shards = number\_of\_shards \* 2

**URL:** <https://discuss.elastic.co/t/confused-about-index-health-active-shards-unassigned-shards-number-of-shards-2/11270>\
**Category:** Elasticsearch\
**Created:** [March 22, 2013, 8:18pm UTC](https://discuss.elastic.co/t/confused-about-index-health-active-shards-unassigned-shards-number-of-shards-2/11270 "2013-03-22T20:18:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arne\_Claassen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arne_claassen/32/2417_2.png) [@Arne\_Claassen](https://discuss.elastic.co/u/Arne_Claassen)\
**Post date:** [March 22, 2013, 8:18pm UTC](https://discuss.elastic.co/t/confused-about-index-health-active-shards-unassigned-shards-number-of-shards-2/11270/1 "2013-03-22T20:18:09Z")

</div>

I'm running elastic search on a single server right now with shards  
set to 6 for future addition of nodes. When i restart the server I  
always get roughtly as many unassigned shards as active shards and  
looking at each index's details they all look the same, i.e.  
active\_shards + unassigned\_shards = number\_of\_shards \* 2, where each  
"shard" has both an active\_shard and an unassigned\_shard like this:  
"site\_1234": {  
"status": "yellow",  
"number\_of\_shards": 6,  
"number\_of\_replicas": 1,  
"active\_primary\_shards": 6,  
"active\_shards": 6,  
"relocating\_shards": 0,  
"initializing\_shards": 0,  
"unassigned\_shards": 6,  
"shards": {  
"0": {  
"status": "yellow",  
"primary\_active": true,  
"active\_shards": 1,  
"relocating\_shards": 0,  
"initializing\_shards": 0,  
"unassigned\_shards": 1  
},  
...  
},  
}

Clearly something is off since it causes the status for the index to  
be yellow and the whole server red, but everything is working fine as  
well.

Any suggestions on what I may have misconfigured?

thanks,  
arne

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Jerome\_Gagnon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jerome_gagnon/32/2178_2.png) [@Jerome\_Gagnon](https://discuss.elastic.co/u/Jerome_Gagnon)\
**Post date:** [March 25, 2013, 2:27pm UTC](https://discuss.elastic.co/t/confused-about-index-health-active-shards-unassigned-shards-number-of-shards-2/11270/2 "2013-03-25T14:27:44Z")

</div>

That's because you activated 1 replicas and running on a single machine, it  
makes little to no sense to put the replicas on the same machine as the  
primary, so the replicas are not being allocated, which cause half of your  
shard (replicas) to not being allocated and your cluster to be in yellow  
state.

Jerome

On Friday, March 22, 2013 4:18:09 PM UTC-4, Arne Claassen wrote:

> I'm running Elasticsearch on a single server right now with shards  
> set to 6 for future addition of nodes. When i restart the server I  
> always get roughtly as many unassigned shards as active shards and  
> looking at each index's details they all look the same, i.e.  
> active\_shards + unassigned\_shards = number\_of\_shards \* 2, where each  
> "shard" has both an active\_shard and an unassigned\_shard like this:  
> "site\_1234": {  
> "status": "yellow",  
> "number\_of\_shards": 6,  
> "number\_of\_replicas": 1,  
> "active\_primary\_shards": 6,  
> "active\_shards": 6,  
> "relocating\_shards": 0,  
> "initializing\_shards": 0,  
> "unassigned\_shards": 6,  
> "shards": {  
> "0": {  
> "status": "yellow",  
> "primary\_active": true,  
> "active\_shards": 1,  
> "relocating\_shards": 0,  
> "initializing\_shards": 0,  
> "unassigned\_shards": 1  
> },  
> ...  
> },  
> }
> 
> Clearly something is off since it causes the status for the index to  
> be yellow and the whole server red, but everything is working fine as  
> well.
> 
> Any suggestions on what I may have misconfigured?
> 
> thanks,  
> arne

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Arne\_Claassen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arne_claassen/32/2417_2.png) [@Arne\_Claassen](https://discuss.elastic.co/u/Arne_Claassen)\
**Post date:** [March 27, 2013, 11:26pm UTC](https://discuss.elastic.co/t/confused-about-index-health-active-shards-unassigned-shards-number-of-shards-2/11270/3 "2013-03-27T23:26:43Z")

</div>

Yup, that does not make sense. I had intended 0 replicas but clearly  
made a mistake in my configuration. Thanks for pointing it out

On Mar 25, 7:27 am, Jérôme Gagnon [jerome.gagno...@gmail.com](mailto:jerome.gagno...@gmail.com) wrote:

> That's because you activated 1 replicas and running on a single machine, it  
> makes little to no sense to put the replicas on the same machine as the  
> primary, so the replicas are not being allocated, which cause half of your  
> shard (replicas) to not being allocated and your cluster to be in yellow  
> state.
> 
> Jerome
> 
> On Friday, March 22, 2013 4:18:09 PM UTC-4, Arne Claassen wrote:
> 
> > I'm running Elasticsearch on a single server right now with shards  
> > set to 6 for future addition of nodes. When i restart the server I  
> > always get roughtly as many unassigned shards as active shards and  
> > looking at each index's details they all look the same, i.e.  
> > active\_shards + unassigned\_shards = number\_of\_shards \* 2, where each  
> > "shard" has both an active\_shard and an unassigned\_shard like this:  
> > "site\_1234": {  
> > "status": "yellow",  
> > "number\_of\_shards": 6,  
> > "number\_of\_replicas": 1,  
> > "active\_primary\_shards": 6,  
> > "active\_shards": 6,  
> > "relocating\_shards": 0,  
> > "initializing\_shards": 0,  
> > "unassigned\_shards": 6,  
> > "shards": {  
> > "0": {  
> > "status": "yellow",  
> > "primary\_active": true,  
> > "active\_shards": 1,  
> > "relocating\_shards": 0,  
> > "initializing\_shards": 0,  
> > "unassigned\_shards": 1  
> > },  
> > ...  
> > },  
> > }
> 
> > Clearly something is off since it causes the status for the index to  
> > be yellow and the whole server red, but everything is working fine as  
> > well.
> 
> > Any suggestions on what I may have misconfigured?
> 
> > thanks,  
> > arne

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:44am UTC](https://discuss.elastic.co/t/confused-about-index-health-active-shards-unassigned-shards-number-of-shards-2/11270/4 "2017-07-06T02:44:04Z")

</div>


