Does Elasticsearch ensures that all the replica shards are distributed in other data nodes?

Does Elasticsearch automatically ensures that all the replica shards are distributed in other data nodes irrespective of the number of shards and no of data nodes ?

Say I have 3 ES nodes and For an Index A , I have 10 shards,
Assuming the primary shards is Distributed uniformly in 3 ES Boxes
My question is Does Elasticsearch distributes the replica shards of the 10 primary shards in such a way that If any of the box out of the 3 ES Nodes went down , the data loss won't happens ?

Yes, a replica shard will never be allocated to the same node as the corresponding primary shard.

So If I have X number of Data Nodes and Y no of Shards with Z No of Replication Factor ,
ES guarantees Failure of Any Boxes in X won't causes any data loss ?

To be clear ,Say If I have 3 Nodes and 4 shard for my index , Then then the primary and replica shard will
be distributed as below [p - Primary Shard and r-Replica Shard ]

Node 1 - [p1, r2 , r4 ] Node 2 =[p2 , r3] Node 3 - [p3 , p4 , r1 ] ,
So that failure of any nodes won't cause chaos !

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