# Disaster Planning

**URL:** <https://discuss.elastic.co/t/disaster-planning/139405>\
**Category:** Elasticsearch\
**Created:** [July 10, 2018, 5:08pm UTC](https://discuss.elastic.co/t/disaster-planning/139405 "2018-07-10T17:08:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikeme1988](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@mikeme1988](https://discuss.elastic.co/u/mikeme1988)\
**Post date:** [July 10, 2018, 5:08pm UTC](https://discuss.elastic.co/t/disaster-planning/139405/1 "2018-07-10T17:08:47Z")

</div>

Hi everyone!

First off let me in advance apologize for the probably dumb question but I am fairly new to Elasticsearch.

This all assumes that the master nodes are dedicated and running.

I am trying to do disaster recovery planning and I am not seeing (or not understanding completely how Elasticsearch works) how to calculate for data node failures. An example of this would be if I had 4 data nodes and each index has 5 shards and 1 replica how many data nodes can I lose at once? Lets say that 2 of the 4 nodes are in a single rack and the rack goes down. What if a single node fails and allows time to replicate and bring up all the replica shards then another node fails?

I was trying to find a formula or something that would say if you have X nodes with X shards and X replicas this is what will happen? Or is it the data is still available as long as one node is up and happens to have a single shard of that index?

Any info or help or links would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 10, 2018, 5:51pm UTC](https://discuss.elastic.co/t/disaster-planning/139405/2 "2018-07-10T17:51:02Z")

</div>

If you have 1 replica configured you can lose one node at once without losing access to the data. Once this happens a new replica will get allocated. Once all shards again are allocated you can again afford to lose a single node.

If you have multiple racks or availability zones, you can use [shard allocation awareness](https://www.elastic.co/guide/en/elasticsearch/reference/6.3/allocation-awareness.html) to make sure that both primary and replica of the same shard are both places within the same rack or availability zone. This way you can lose a full rack without losing access to your data.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 7, 2018, 5:51pm UTC](https://discuss.elastic.co/t/disaster-planning/139405/3 "2018-08-07T17:51:02Z")

</div>

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