Using ES 6.1.0.
I'm trying to understand what might be happening (either I'm doing something wrong or I'm misreading the documentation).
I have a cluster where I have 2 physical machines. On each physical machine I launch multiple data nodes. I'm configuring indexes to have 5 primary shards and 1 replica.
I've configured awareness to be on the physical host name, set the physical host name on each data node, and listed all the physical host names in the forced awareness arg.
When I create an index, I can see the primary shard and replica shard always assigned to nodes that reside on different physical machines.
However, if I change the replica count to 2, the cluster assigns both replicas. My understanding from the docs is that the 2nd replica shouldn't be assigned because there there are only 2 unique forced attributes, so one replica shard should go unassigned.
Snippet of cluster config (names replaced):
"settings": {
"cluster": {
"name": "myCluster",
"routing": {
"allocation": {
"awareness": {
"attributes": "host",
"force": {
"host": {
"values": "physicalHost1,physicalHost2"
}
}
}
}
}
},
"node": {
"name": "physicalHost1.data7",
"attr": {
"host": "physicalHost1"
},
"data": "true",
"ingest": "true",
"master": "false"
}
Similarly, if I change replica count to 3, it assigns all 3, but it does ensure that between the 4 copies (1 primary and 3 replicas), 2 copies end up on 1 physical host, and 2 on the other.
Does forced awareness only ensure that 1 replica ends up on a node that has different properties? (and any additional replicas get distributed ignoring the properties?)