pelias / terraform-elasticsearch

Terraform scripts for running an Elasticsearch cluster
10 stars 6 forks source link

Availability Zone allocation awareness #6

Closed orangejulius closed 5 years ago

orangejulius commented 5 years ago

When using an Elasticsearch cluster spread across multiple EC2 availability zones, it makes sense to ensure that replica shards are always in a different availability zone than the corresponding primary shard.

While not 100% guaranteed, AWS designs availability zones to be generally independent in terms of outages, so it can make a cluster much more resilient against failure.

This PR uses the EC2 Discovery plugin to set the availability attribute on each node, and then use shard allocation awareness on the availability zone property to ensure shards are well distributed.

Closes https://github.com/pelias/terraform-elasticsearch/issues/5

missinglink commented 5 years ago

Wow, sounds fancy!