# Basic HA/Failover Setup

**URL:** https://discuss.elastic.co/t/basic-ha-failover-setup/198567
**Category:** Elasticsearch
**Created:** [September 8, 2019, 4:03pm UTC](https://discuss.elastic.co/t/basic-ha-failover-setup/198567 "2019-09-08T16:03:10Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![revglen](https://avatars.discourse-cdn.com/v4/letter/r/ea666f/32.png) [@revglen](https://discuss.elastic.co/u/revglen)
#### Post date: [September 8, 2019, 4:03pm UTC](https://discuss.elastic.co/t/basic-ha-failover-setup/198567/1 "2019-09-08T16:03:10Z")

</div>

Hi All, I am looking for the basic configuration for HA/Failover. I have 2 clusters.  
The first cluster consists of separate coordinating and master/data nodes running in 2 processes in one system while in the 2nd cluster the Master/Data nodes run as one unit. The configurations are below

**Master Node on Cluster 1 on Machine 1**

```
cluster.name: remote
node.name: Remote-Master
node.master: false
node.data: false
node.ingest: false
path.data: D:\ELK-Runnable\Elasticsearch\data
path.logs: D:\ELK-Runnable\Elasticsearch\logs
network.host: 0.0.0.0
http.port: 9200
transport.port: 9300
discovery.zen.minimum_master_nodes: 1
discovery.zen.ping.unicast.hosts: ["0.0.0.0:9300", "0.0.0.0:9301", "192.168.116.138:9300"]

```

**Data Node on Cluster 1 on Machine 1**

```
cluster.name: remote
node.name: Remote-Data
node.master: true
node.data: true
path.data: D:\ELK-Runnable\Elasticsearch_Data\data
path.logs: D:\ELK-Runnable\Elasticsearch_Data\logs
network.host: 0.0.0.0
http.port: 9201
transport.port: 9301
discovery.zen.ping.unicast.hosts: ["0.0.0.0:9300", "0.0.0.0:9301","192.168.116.138:9300"]

```

**Master and Data on Cluster 2 on Machine 2**

```
cluster.name: backup
path.data: C:\Program Files\Elasticsearch\data
path.logs: C:\Program Files\Elasticsearch\logs
network.host: 0.0.0.0
http.port: 9200
transport.port: 9300
discovery.zen.ping.unicast.hosts: ["192.168.119.1:9300", "192.168.119.1:9301", "0.0.0.0:9300"]

```

I uploaded 1 index and it was done successfully. I have enabled data replication and data is successfully copied to the 2nd cluster. Now, I shutdown the Master/Data node in cluster 1 and was hoping that the 2nd cluster would support the failover. I have added the 2nd cluster node in the zen discovery section of the .yml file. However, it does not work. Any suggestions would be helpful. Thanks

---

<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: [September 8, 2019, 5:11pm UTC](https://discuss.elastic.co/t/basic-ha-failover-setup/198567/2 "2019-09-08T17:11:18Z")

</div>

A cluster [cannot tolerate the loss of half or more of its master-eligible nodes](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-quorums.html). Therefore you need at least three master-eligible nodes in order to have a fault-tolerant cluster.

---

<div class="post-metadata">

### Author: ![revglen](https://avatars.discourse-cdn.com/v4/letter/r/ea666f/32.png) [@revglen](https://discuss.elastic.co/u/revglen)
#### Post date: [September 8, 2019, 6:54pm UTC](https://discuss.elastic.co/t/basic-ha-failover-setup/198567/3 "2019-09-08T18:54:21Z")

</div>

Thanks David. I am still a newbie to this. So pl correct my understanding here  
I have the following

```
1 (call it A1) - Coordinating & Master Nodes in 1 process on Machine A in Cluster 1
1 (call it A2)- Data & Master Nodes in 1 process on Machine A in Cluster 1

```

`1 (call it B1) Master and Data in 1 process on Machine B in Cluster 2` This has been configured with CCR.

Now, I stop `A2` hence `A1` should link to `B1`. However, this does not happen.  
So if we need to have 3 master eligible nodes, this would mean the following

- Potentially having 2 Master nodes and a Data Node in Cluster 1. Total of 3 Nodes
- Next, stop the Data Node to mimic a failover scenario
- Cluster 1 will automatically fall back on the Node in Cluster 2

Is this assertion correct?

---

<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: [September 8, 2019, 7:41pm UTC](https://discuss.elastic.co/t/basic-ha-failover-setup/198567/4 "2019-09-08T19:41:12Z")

</div>

> [@revglen](#):
>
> Now, I stop `A2` hence `A1` should link to `B1` .

No, that's not what should happen. There's no safe way to move a node to a different cluster without risking data loss, so Elasticsearch won't do that. If you stop `A2` then you have stopped half of the master-eligible nodes in cluster A, and the only safe way to proceed is to start `A2` again.

---

<div class="post-metadata">

### Author: ![revglen](https://avatars.discourse-cdn.com/v4/letter/r/ea666f/32.png) [@revglen](https://discuss.elastic.co/u/revglen)
#### Post date: [September 8, 2019, 8:09pm UTC](https://discuss.elastic.co/t/basic-ha-failover-setup/198567/5 "2019-09-08T20:09:42Z")

</div>

Cool. Thanks David. I will figure something out...

---

<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: [September 8, 2019, 8:58pm UTC](https://discuss.elastic.co/t/basic-ha-failover-setup/198567/6 "2019-09-08T20:58:46Z")

</div>

Why do you not just set up a single cluster with 3 nodes that hold data and are master eligible? This cluster can handle one node failing and is highly available.

---

<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: [October 6, 2019, 8:58pm UTC](https://discuss.elastic.co/t/basic-ha-failover-setup/198567/7 "2019-10-06T20:58:49Z")

</div>

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