We are currently running a diverse ES install, with 10+ servers
running in four different data centres. As such, I would like to
change the default sharding method to increase the number of replicas,
as I'd prefer that when a remote DC goes offline for any reason, I
don't end up with all the replicas for one shard at the end of that
now dead link.
Ideally, I'd like there to be one copy of each shard in each DC, so
four shards total, and weighted by server location.
I looked at the ES website but honestly, it's pretty thin on details
when it comes to configuring the server. Any tips would be
appreciated, thanks.
node.zone: uk
cluster.routing.allocation.awareness.attributes: zone
For my local DC:
node.zone: local
cluster.routing.allocation.awareness.attributes: zone
So now there's a copy of each shard in each zone, but I'd like 2
copies of each shard in each zone. The docs suggest that the
following option should do this:
If you want 2 copies on each zone, then set the index.number_of_replicas to
3 (in addition to the primary, it means you will have 4 copies). I highly
suggest using forced allocation awareness in this case.
node.zone: uk
cluster.routing.allocation.awareness.attributes: zone
For my local DC:
node.zone: local
cluster.routing.allocation.awareness.attributes: zone
So now there's a copy of each shard in each zone, but I'd like 2
copies of each shard in each zone. The docs suggest that the
following option should do this:
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.