# Unassigned shards due to awareness allocation

**URL:** <https://discuss.elastic.co/t/unassigned-shards-due-to-awareness-allocation/105202>\
**Category:** Elasticsearch\
**Created:** [October 25, 2017, 8:38am UTC](https://discuss.elastic.co/t/unassigned-shards-due-to-awareness-allocation/105202 "2017-10-25T08:38:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dhara\_Desai](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dhara_desai/32/15760_2.png) [@Dhara\_Desai](https://discuss.elastic.co/u/Dhara_Desai)\
**Post date:** [October 25, 2017, 8:38am UTC](https://discuss.elastic.co/t/unassigned-shards-due-to-awareness-allocation/105202/1 "2017-10-25T08:38:33Z")

</div>

We are using elasticsearch 1.7.4, cluster settings are following with around ~400 nodes evenly distributed across aws\_availability\_zone

cluster.routing.allocation.awareness.attributes: aws\_availability\_zone  
cluster.routing.allocation.awareness.force.aws\_availability\_zone.values: us-east-1a,us-east-1d,us-east-1e

one of the index consist of 1 primary and 17 replica, so the expected behaviour is 6 shards per aws\_availability\_zone, but I see 3 shards unassigned.

When I try to manualy allocate the shard to hosts in those 3 aws\_availability\_zone, it says "too many shards on nodes for attribute: [aws\_availability\_zone]"

I verified using \_cat/shards?index=my\_index, 1a, 1d and 1e have 5 shards each. As per AwarenessAllocationDecider,  
shardCount = 18 (17+1)  
averagePerAttribute = 6 (18/3)  
requiredCountPerAttribute = 6  
leftoverPerAttribute = 0  
currentNodeCount = 5

and (currentNodeCount \> (requiredCountPerAttribute + leftoverPerAttribute)) -\> false then why am I getting allocation decision NO

It will be great if someone can help me debug this !

Also the way we work around this problem is increase the replica count to large number (not losing quorum) 23, it will start assiging a batch of shards and come back to 17. I think due to this I observed another index with 5 shards in 1a, 5 shards in 1d, 7 shards in 1e and 1 unassigned shard, which is strange becasue it should rebalance and and not let more than 6 shards in aws\_availability\_zone.

It will be great if you can point me to any related issue

---

<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:** [October 25, 2017, 2:44pm UTC](https://discuss.elastic.co/t/unassigned-shards-due-to-awareness-allocation/105202/2 "2017-10-25T14:44:14Z")

</div>

I'm sure you know it already but really so many things changed since 1.7.4 (almost 2 years of dev). And we don't support this version anymore.

Could you think of reindexing your data in a fresh new cluster running latest 5.6?  
You would benefit from a lot of great improvements IMO.

(Sorry not answering your question)

---

<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:** [November 22, 2017, 2:44pm UTC](https://discuss.elastic.co/t/unassigned-shards-due-to-awareness-allocation/105202/3 "2017-11-22T14:44:23Z")

</div>

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