Allocation awareness + force doesn't work on ES 2.4.1

I'm running 15 data nodes of ES 2.4.1. The nodes is grouped by attribute node.serverno like bellow

es1  -> node.serverno=svr1      
es2  -> node.serverno=svr1     
es3  -> node.serverno=svr1      
es4  -> node.serverno=svr2      
es5  -> node.serverno=svr2      
es6  -> node.serverno=svr2      
es7  -> node.serverno=svr3      
es8  -> node.serverno=svr3      
es9  -> node.serverno=svr3      
es10 -> node.serverno=svr4      
es11 -> node.serverno=svr4      
es12 -> node.serverno=svr4      
es13 -> node.serverno=svr5      
es14 -> node.serverno=svr5      
es15 -> node.serverno=svr5 

The cluster has indices of 12 shards + 1 replication. My idea is limiting shards so they only allocated to node.serverno: svr1/svr2/svr3. Then, I tried to apply cluster awareness & force:

{
  "transient":{
    "cluster.routing.allocation.awareness.attributes": "serverno"
  }
}

{
  "transient":{
    "cluster.routing.allocation.awareness.force.serverno.values": "svr1,svr2,svr3"
  }
}

Here what happen:

  1. Before apply *.awareness.* :
    All shard & replication spread to all nodes

  2. After apply cluster.routing.allocation.awareness.attributes:
    Replication shards in the node with same node.serverno value move to other nodes with different node.serverno

  3. After apply cluster.routing.allocation.awareness.force.serverno.values:
    The state is same as step 2. I expected that all primary + replication shards only spread to nodes with node.serverno is svr1 / svr2 / svr3.

I've read https://www.elastic.co/guide/en/elasticsearch/reference/2.4/allocation-awareness.html but might missed understand.

Any advice about that?

Forced awareness is used to make sure that there is no more than one shard copy (either the primary or one of its replicas) per value that you have defined as forced awareness values. It is not used for limiting shard copies to live on nodes with those values only.

What you want to do can be achieved with shard filtering.

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