# Cluster.routing.allocation.awareness.attributes doesn't seem to work

**URL:** <https://discuss.elastic.co/t/cluster-routing-allocation-awareness-attributes-doesnt-seem-to-work/238548>\
**Category:** Elasticsearch\
**Created:** [June 24, 2020, 7:07pm UTC](https://discuss.elastic.co/t/cluster-routing-allocation-awareness-attributes-doesnt-seem-to-work/238548 "2020-06-24T19:07:05Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![mannoj87](https://avatars.discourse-cdn.com/v4/letter/m/bc8723/32.png) [@mannoj87](https://discuss.elastic.co/u/mannoj87)\
**Post date:** [June 24, 2020, 7:07pm UTC](https://discuss.elastic.co/t/cluster-routing-allocation-awareness-attributes-doesnt-seem-to-work/238548/1 "2020-06-24T19:07:05Z")

</div>

Hi Team,

cluster.routing.allocation.awareness.attributes: 34

And I have 2 VMs with this same value. [prd-es107.com](http://prd-es107.com) and [prd-es108.com](http://prd-es108.com). Both has 34.

I have almost 86 nodes in my cluster.

Below is the shard allocation I get.  
table-05-4-2020 4 p STARTED 3800928 5gb 10.2.0.7 [prd-es107.com](http://prd-es107.com)  
table-05-4-2020 4 r STARTED 3800928 5gb 10.2.0.8 [prd-es108.com](http://prd-es108.com)

The shards of same name and number should be allocated to a different cluster.routing.allocation.awareness.attributes value and not to same 34 .

Correct me if my understanding or variable setting is wrong.

Regards,  
Mannoj Kumar

---

<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:** [June 25, 2020, 1:10am UTC](https://discuss.elastic.co/t/cluster-routing-allocation-awareness-attributes-doesnt-seem-to-work/238548/2 "2020-06-25T01:10:50Z")

</div>

Do the other nodes have attributes set?

---

<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:** [June 25, 2020, 3:29am UTC](https://discuss.elastic.co/t/cluster-routing-allocation-awareness-attributes-doesnt-seem-to-work/238548/3 "2020-06-25T03:29:04Z")

</div>

How do s your shard allocation awareness configured?

---

<div class="post-metadata">

**Author:** ![mannoj87](https://avatars.discourse-cdn.com/v4/letter/m/bc8723/32.png) [@mannoj87](https://discuss.elastic.co/u/mannoj87)\
**Post date:** [June 25, 2020, 5:07am UTC](https://discuss.elastic.co/t/cluster-routing-allocation-awareness-attributes-doesnt-seem-to-work/238548/4 "2020-06-25T05:07:01Z")

</div>

yes, all nodes.

---

<div class="post-metadata">

**Author:** ![mannoj87](https://avatars.discourse-cdn.com/v4/letter/m/bc8723/32.png) [@mannoj87](https://discuss.elastic.co/u/mannoj87)\
**Post date:** [June 25, 2020, 5:08am UTC](https://discuss.elastic.co/t/cluster-routing-allocation-awareness-attributes-doesnt-seem-to-work/238548/5 "2020-06-25T05:08:52Z")

</div>

Just with this setting. Nothing else.  
cluster.routing.allocation.awareness.attributes: 34

---

<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:** [June 25, 2020, 5:18am UTC](https://discuss.elastic.co/t/cluster-routing-allocation-awareness-attributes-doesnt-seem-to-work/238548/6 "2020-06-25T05:18:15Z")

</div>

It does not sound like you have configured it correctly. Have a look at [the docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-cluster.html#shard-allocation-awareness) for examples.

---

<div class="post-metadata">

**Author:** ![mannoj87](https://avatars.discourse-cdn.com/v4/letter/m/bc8723/32.png) [@mannoj87](https://discuss.elastic.co/u/mannoj87)\
**Post date:** [June 25, 2020, 7:07am UTC](https://discuss.elastic.co/t/cluster-routing-allocation-awareness-attributes-doesnt-seem-to-work/238548/7 "2020-06-25T07:07:43Z")

</div>

Should it be like this ?

node.attr.rack\_id: 34  
cluster.routing.allocation.awareness.attributes: rack\_id

---

<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:** [June 25, 2020, 7:23am UTC](https://discuss.elastic.co/t/cluster-routing-allocation-awareness-attributes-doesnt-seem-to-work/238548/8 "2020-06-25T07:23:42Z")

</div>

Yes, I think that looks better.

---

<div class="post-metadata">

**Author:** ![mannoj87](https://avatars.discourse-cdn.com/v4/letter/m/bc8723/32.png) [@mannoj87](https://discuss.elastic.co/u/mannoj87)\
**Post date:** [June 30, 2020, 9:24pm UTC](https://discuss.elastic.co/t/cluster-routing-allocation-awareness-attributes-doesnt-seem-to-work/238548/9 "2020-06-30T21:24:33Z")

</div>

I made the setting on an existing cluster that has P and R on same BM and I have mentioned like below.

node.attr.rack\_id: 028  
cluster.routing.allocation.awareness.attributes: rack\_id

After this setting did rolling restart on both the nodes, now cluster is green.

But I still see the shard P and R are staying on same BM no change found after change and restarts.

---

<div class="post-metadata">

**Author:** ![mannoj87](https://avatars.discourse-cdn.com/v4/letter/m/bc8723/32.png) [@mannoj87](https://discuss.elastic.co/u/mannoj87)\
**Post date:** [July 3, 2020, 8:20am UTC](https://discuss.elastic.co/t/cluster-routing-allocation-awareness-attributes-doesnt-seem-to-work/238548/10 "2020-07-03T08:20:23Z")

</div>

can someone help me here? Or should I have to run a job that keeps moving the shards not to go on same BM? Setting in ES doesn't seems to work.

---

<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 31, 2020, 8:20am UTC](https://discuss.elastic.co/t/cluster-routing-allocation-awareness-attributes-doesnt-seem-to-work/238548/11 "2020-07-31T08:20:35Z")

</div>

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