# Unassigned shards after adding Shard Allocation Awareness

**URL:** <https://discuss.elastic.co/t/unassigned-shards-after-adding-shard-allocation-awareness/65522>\
**Category:** Elasticsearch\
**Created:** [November 9, 2016, 4:01pm UTC](https://discuss.elastic.co/t/unassigned-shards-after-adding-shard-allocation-awareness/65522 "2016-11-09T16:01:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![meons](https://avatars.discourse-cdn.com/v4/letter/m/b5a626/32.png) [@meons](https://discuss.elastic.co/u/meons)\
**Post date:** [November 9, 2016, 4:01pm UTC](https://discuss.elastic.co/t/unassigned-shards-after-adding-shard-allocation-awareness/65522/1 "2016-11-09T16:01:35Z")

</div>

I have an elastic cluster with 4 nodes running elasticsearch 2.3.3 with 3TB data and I use Kopf plugin as cluster "dashboard".  
I changed my cluster configuration by adding Shard Allocation Awareness, so I added the following lines in elasticsearch.yml on my nodes :

Nodes 1 and 2:

> node.rack\_id: 01  
> cluster.routing.allocation.awareness.attributes: rack\_id

Nodes 3 and 4:

> node.rack\_id: 02  
> cluster.routing.allocation.awareness.attributes: rack\_id

Then I have restarted elasticsearch service on each node one by one bit I still have 133 unassigned shards on my cluster. First I had around 1000 shards which has been reallocated and the decease stoped at 133 shards. It's seems that the process is running and still trying to reallocate theses shards.

I alredy tried to disable and enable routing.allocation but the issue is still present.

> PUT /\_cluster/settings  
> {  
> "transient" : {  
> "cluster.routing.allocation.enable" : "none"  
> }  
> }  
> PUT /\_cluster/settings  
> {  
> "transient" : {  
> "cluster.routing.allocation.enable" : "all"  
> }  
> }

Do you have any idea how can I fix that ?

---

<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:** [November 9, 2016, 4:07pm UTC](https://discuss.elastic.co/t/unassigned-shards-after-adding-shard-allocation-awareness/65522/2 "2016-11-09T16:07:48Z")

</div>

Do you have any indices with more then 1 replica configured?

---

<div class="post-metadata">

**Author:** ![meons](https://avatars.discourse-cdn.com/v4/letter/m/b5a626/32.png) [@meons](https://discuss.elastic.co/u/meons)\
**Post date:** [November 9, 2016, 4:10pm UTC](https://discuss.elastic.co/t/unassigned-shards-after-adding-shard-allocation-awareness/65522/3 "2016-11-09T16:10:50Z")

</div>

Nope, all indices with unassigned shards have 1 replica configured ("number\_of\_replicas": "1").

---

<div class="post-metadata">

**Author:** ![meons](https://avatars.discourse-cdn.com/v4/letter/m/b5a626/32.png) [@meons](https://discuss.elastic.co/u/meons)\
**Post date:** [November 9, 2016, 4:18pm UTC](https://discuss.elastic.co/t/unassigned-shards-after-adding-shard-allocation-awareness/65522/4 "2016-11-09T16:18:19Z")

</div>

I have already tried that a few months ago so I know if I remove Shard Allocation Awareness configuration and restart elasticsearch service in all nodes, all shards will be allocated. But know I really need this configuration to ensure that all replicas will only be on nodes that are in the same rack.

---

<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:** [December 7, 2016, 4:18pm UTC](https://discuss.elastic.co/t/unassigned-shards-after-adding-shard-allocation-awareness/65522/5 "2016-12-07T16:18:27Z")

</div>

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