# Disable "cluster.routing.allocation.same\_shard.host: true" for a particular index

**URL:** <https://discuss.elastic.co/t/disable-cluster-routing-allocation-same-shard-host-true-for-a-particular-index/164172>\
**Category:** Elasticsearch\
**Created:** [January 14, 2019, 4:22pm UTC](https://discuss.elastic.co/t/disable-cluster-routing-allocation-same-shard-host-true-for-a-particular-index/164172 "2019-01-14T16:22:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sylmarch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylmarch/32/109826_2.png) [@Sylmarch](https://discuss.elastic.co/u/Sylmarch)\
**Post date:** [January 14, 2019, 4:22pm UTC](https://discuss.elastic.co/t/disable-cluster-routing-allocation-same-shard-host-true-for-a-particular-index/164172/1 "2019-01-14T16:22:48Z")

</div>

I have a cluster of 3 big physical machines (i.e. with a lot of RAM) so I'm hosting multiple nodes on each physical host.

So, I define a node attribute named `shard_allocation` on each node whose value is the hostname of the physical machine : `node.attr.shard_allocation: ${HOSTNAME}`

Then I set `cluster.routing.allocation.awareness.attributes: shard_allocation` so that the cluster prefers to put the same shards on different hosts (to be resilient to the crash of a physical machine)

Note: I cannot use `cluster.routing.allocation.same_shard.host: true` because nodes on one particular node have the value `<hostname>_<nodename>` instead of `hostname`.

* * *

For a particular use cases, I want that all the shards of a specific index are available on every nodes.

So I set its replica factor to `(number to the number of hosts - 1)`.

However, some shards stay unassigned.  
With the `https://<host>:9200/_cluster/allocation/explain` endpoint, I get this error message:

`"there are too many copies of the shard allocated to nodes with attribute [shard_allocation], there are [16] total configured shard copies for this shard id and [6] total attribute values, expected the allocated shard count per attribute [4] to be less than or equal to the upper bound of the required number of shards per attribute [3]"`

* * *

**Questions:**

- do you know if it's possible to disable `cluster.routing.allocation.awareness.attributes` for a specific index?
- do you have any suggestion to solve this issue?

Reducing the number of replicas is not a solution because I want the index be present on each node.

Thanks.

---

<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:** [February 11, 2019, 4:22pm UTC](https://discuss.elastic.co/t/disable-cluster-routing-allocation-same-shard-host-true-for-a-particular-index/164172/2 "2019-02-11T16:22:49Z")

</div>

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