Disable "cluster.routing.allocation.same_shard.host: true" for a particular index

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.

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