# Enable/Disable shard allocation awareness dynamically

**URL:** <https://discuss.elastic.co/t/enable-disable-shard-allocation-awareness-dynamically/142523>\
**Category:** Elasticsearch\
**Created:** [August 1, 2018, 9:29am UTC](https://discuss.elastic.co/t/enable-disable-shard-allocation-awareness-dynamically/142523 "2018-08-01T09:29:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhibansal530](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@abhibansal530](https://discuss.elastic.co/u/abhibansal530)\
**Post date:** [August 1, 2018, 9:29am UTC](https://discuss.elastic.co/t/enable-disable-shard-allocation-awareness-dynamically/142523/1 "2018-08-01T09:29:25Z")

</div>

So I am playing around with shard allocation awareness. I currently have three nodes. For two of them I have a rack\_id attribute set to rack\_1. And third node don't has this attribute. Now for my index I have 10 shard with 2 replicas, i.e. total of 30 shards. So without any shard allocation awareness it allocates 10 shards on each node. Now when I use cluster update settings API to dynamically set ''cluster.routing.allocation.awareness.attributes : rack\_id", according to documentation expected behavior is to not assign any shards on node 3 (with no rack\_id attribute). But when I check my shards they are still allocated to all nodes evenly. Then I searched and found about the Explain API. And using that on one of shards allocated to node3, it says {"can\_remain\_on\_current\_node":"no", can\_remain\_decisions":[{"decider":"awareness","decision":"NO","explanation":"node does not contain the awareness attribute [rack\_id]}. So I am a bit confused here, what's going on. If its not allowed there then why is it assigned then. And if it means that it'll be unassigned after a restart of node3, then what's the point of changing settings dynamically. End goal that I want to achieve is to dynamically enable/disable shard allocation awareness. Can anyone help me here. And I am running Elasticsearch v5.2.

---

<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:** [August 29, 2018, 9:29am UTC](https://discuss.elastic.co/t/enable-disable-shard-allocation-awareness-dynamically/142523/2 "2018-08-29T09:29:26Z")

</div>

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