I have a 5 node ElasticSearch cluster which locates in 3 DataCenters
DC1:
ES01 (master-eligible, data)
ES02 (data)
DC2:
ES03 (master-eligible, data)
ES04 (data)
DC3:
ES05 (Master only node)
so i need to continue Read/Write operations in case of any DC Failure for example if DC2 is down, cluster now consists of 3 nodes (ES-01, ES-02 and ES-05) and it works so how many shards/ or other settings, like consistency for Reading/Writing should i have to be a DC fault tolerant? i think the (1 primary shards and 3 replica shards is good for that case) any suggestions? or its better to use 2 primary and 2 replica shards in that case?
The number of primaries don't matter for this as they are not guaranteed to be on separate nodes - the index (primary) shard count is for scaling data size or query performance, not any failure, etc.
The number of replicas is important, i.e. you'd use 3 if you want data on all four data nodes.
So I'd think you'd start with 1 primary and 3 replicas for simplicity, though you can also use 1 primary and and 1 replica if you use location awareness (see docs), as that will make sure the primary and replicas are not in the same DC. This saves disk space, of course.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.