# How to set up a highly available elasticsearch cluster locally?

**URL:** https://discuss.elastic.co/t/how-to-set-up-a-highly-available-elasticsearch-cluster-locally/267803
**Category:** Elasticsearch
**Created:** [March 19, 2021, 11:35am UTC](https://discuss.elastic.co/t/how-to-set-up-a-highly-available-elasticsearch-cluster-locally/267803 "2021-03-19T11:35:06Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Belgacem\_Ghiloufi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/belgacem_ghiloufi/32/85800_2.png) [@Belgacem\_Ghiloufi](https://discuss.elastic.co/u/Belgacem_Ghiloufi)
#### Post date: [March 19, 2021, 11:35am UTC](https://discuss.elastic.co/t/how-to-set-up-a-highly-available-elasticsearch-cluster-locally/267803/1 "2021-03-19T11:35:06Z")

</div>

I am new to Elasticsearch and I want to set up a highly available Elasticsearch cluster on one machine to test and learn how to use Elasticsearch. I hope that when the master node fails, one of the other nodes will take over and become the master node. On my machine, I set up an Elasticsearch cluster consisting of 3 nodes, a master node and two data nodes, but when I stopped the master node, none of the other nodes took over and became the master node, here is my config for the three nodes (used version of elasticsearch is 7.9.2):

```auto
# master node config.
cluster.name:demo-cluster
node.name: "es-node-1"
node.master: true
node.data: false
discovery.zen.minimum_master_nodes: 2

```

```auto
# data node 1 config.
cluster.name:demo-cluster
node.name: "es-node-2"
node.master: false
node.data: true
discovery.zen.minimum_master_nodes: 2

```

```auto
# data node 2 config.
cluster.name:demo-cluster
node.name: "es-node-3"
node.master: false
node.data: true
discovery.zen.minimum_master_nodes: 2

```

Does anyone have an idea please?

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [March 19, 2021, 11:58am UTC](https://discuss.elastic.co/t/how-to-set-up-a-highly-available-elasticsearch-cluster-locally/267803/2 "2021-03-19T11:58:55Z")

</div>

You need all nodes to be master eligible.  
I'd encourage keeping all the default values for `node.data` and `node.master`.

---

<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: [March 19, 2021, 12:07pm UTC](https://discuss.elastic.co/t/how-to-set-up-a-highly-available-elasticsearch-cluster-locally/267803/3 "2021-03-19T12:07:53Z")

</div>

In addition to what David said, I suggest you read the [notes in the manual](https://www.elastic.co/guide/en/elasticsearch/reference/current/high-availability-cluster-small-clusters.html#high-availability-cluster-design-three-nodes) on setting up a HA cluster with three nodes. That [whole section of the manual](https://www.elastic.co/guide/en/elasticsearch/reference/current/high-availability-cluster-design.html) is probably of interest to you.

---

<div class="post-metadata">

### Author: ![Belgacem\_Ghiloufi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/belgacem_ghiloufi/32/85800_2.png) [@Belgacem\_Ghiloufi](https://discuss.elastic.co/u/Belgacem_Ghiloufi)
#### Post date: [March 19, 2021, 7:21pm UTC](https://discuss.elastic.co/t/how-to-set-up-a-highly-available-elasticsearch-cluster-locally/267803/4 "2021-03-19T19:21:09Z")

</div>

You mean by keeping all the default values for `node.data` and `node.master`. I don't specify the master nodes and the data nodes even though I have n nodes and I let elasticsearch do it for me, is that right? I’m sorry if I ask a very stupid questions but I have no knowledge in elasticsearch, and soon we will install an elasticsearch cluster for one of our customers, and I need to quickly become familiar with elasticsearch.

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [March 19, 2021, 8:05pm UTC](https://discuss.elastic.co/t/how-to-set-up-a-highly-available-elasticsearch-cluster-locally/267803/5 "2021-03-19T20:05:13Z")

</div>

> [@Belgacem\_Ghiloufi](#):
>
> and soon we will install an elasticsearch cluster for one of our customers, and I need to quickly become familiar with elasticsearch.

You should really attend our trainings then to learn how to do the right things.  
And/or buy a support for your customer so they will get a license and support.  
Or deploy on [cloud.elastic.co](http://cloud.elastic.co).

---

<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: [April 16, 2021, 8:05pm UTC](https://discuss.elastic.co/t/how-to-set-up-a-highly-available-elasticsearch-cluster-locally/267803/6 "2021-04-16T20:05:23Z")

</div>

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