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:
-
Before apply
*.awareness.*
:
All shard & replication spread to all nodes -
After apply
cluster.routing.allocation.awareness.attributes
:
Replication shards in the node with samenode.serverno
value move to other nodes with differentnode.serverno
-
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 withnode.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?