Reputation: 9387
I have a 2 node cluster for Elastic search and the health is in yellow. It looks like there are 10 primary shards and 2 replicas (i.e 2 reaplicas per primary shard so that mean 20 replica shards). If primay is in node1 and can all the replicas be in node 2 or will we need a node 3 for the second replica. I did read that ES does not place replica in the same node as the primay. so does if there a 2 replicas can it place in the same node (node2) or the second one has to be place in node 3
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
yellow open sdfs_v4 D2BpVICsddShJay_iz1FBQ 10 2 870293 28005 7.8gb 3.8gb
yellow open abc_v4 nd-5fffsbcvcxxCqZPVNMCQ 10 2 396914 205632 2.7gb 1.3gb
Upvotes: 0
Views: 973
Reputation: 217344
The way it works is that a primary and any replica cannot be on the same node. So in a two nodes cluster, if the primary is on node1, one replica can be on node2, and all other replicas are unassigned.
The maximum number of replicas you can have is number of nodes - 1
. In your case, having two replicas for each primary in a two-nodes cluster doesn't make sense.
You can either add a new node or decrease the number of replicas.
Upvotes: 2