# About using a two node cluster for data loss prevention

**URL:** https://discuss.elastic.co/t/about-using-a-two-node-cluster-for-data-loss-prevention/333509
**Category:** Elasticsearch
**Created:** [May 15, 2023, 10:11pm UTC](https://discuss.elastic.co/t/about-using-a-two-node-cluster-for-data-loss-prevention/333509 "2023-05-15T22:11:37Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![usaadi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/usaadi/32/113303_2.png) [@usaadi](https://discuss.elastic.co/u/usaadi)
#### Post date: [May 15, 2023, 10:11pm UTC](https://discuss.elastic.co/t/about-using-a-two-node-cluster-for-data-loss-prevention/333509/1 "2023-05-15T22:11:37Z")

</div>

Hello...

I have a question about whether a two nodes cluster can be a sufficient setup in avoiding data loss in the event of the complete failure of one node. In other words, for a two nodes cluster, can it be set up so that each node contains the complete data of the cluster?

The documentation I found is not very clear on this point. I'm not talking about high availability, just the prevention of data loss.

To make this easier to answer, is it correct that if I set the "number\_of\_replicas" setting to 1 for each index, (which is the default), then the data will be mirrored in each node?

I'm asking because I have a requirement to add a second node to our existing one node cluster for better performance as well as a backup, using only two servers.

Thanks,  
Osama

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [May 15, 2023, 11:28pm UTC](https://discuss.elastic.co/t/about-using-a-two-node-cluster-for-data-loss-prevention/333509/2 "2023-05-15T23:28:21Z")

</div>

No.

Yes, the replicas will be allocated so you have that level of redundancy.  
No as you have no majority if you lose a node or there's a network partition or something else that might cause a split brain. Then you risk data loss because if a client is talking to both nodes and sends `documentA` to `node0` and then tries to do an update to `documentA` via `node1` you are immediately out of alignment and you may lose that update.

---

<div class="post-metadata">

### Author: ![usaadi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/usaadi/32/113303_2.png) [@usaadi](https://discuss.elastic.co/u/usaadi)
#### Post date: [May 16, 2023, 12:53am UTC](https://discuss.elastic.co/t/about-using-a-two-node-cluster-for-data-loss-prevention/333509/3 "2023-05-16T00:53:30Z")

</div>

So I guess what this means is that using a two node cluster can be problematic with data loss possibility even without having a node failure.

In light of this, I'm thinking of recommending using either a three nodes cluster, or a single node cluster with snapshots for backup.

Does this sound reasonable?

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [May 16, 2023, 12:53am UTC](https://discuss.elastic.co/t/about-using-a-two-node-cluster-for-data-loss-prevention/333509/4 "2023-05-16T00:53:49Z")

</div>

Yep 🙂

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [May 16, 2023, 10:01am UTC](https://discuss.elastic.co/t/about-using-a-two-node-cluster-for-data-loss-prevention/333509/5 "2023-05-16T10:01:06Z")

</div>

FWIW the reference manual has a section on exactly this topic:

> **[Resilience in small clusters | Elasticsearch Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/high-availability-cluster-small-clusters.html#high-availability-cluster-design-two-nodes)**

> Because it’s not resilient to failures, we do not recommend deploying a two-node cluster in production.

---

<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: [June 13, 2023, 10:01am UTC](https://discuss.elastic.co/t/about-using-a-two-node-cluster-for-data-loss-prevention/333509/6 "2023-06-13T10:01:32Z")

</div>

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