# Unable to create HA with Elasticsearch with 2 master nodes

**URL:** https://discuss.elastic.co/t/unable-to-create-ha-with-elasticsearch-with-2-master-nodes/185753
**Category:** Elasticsearch
**Created:** [June 14, 2019, 3:25am UTC](https://discuss.elastic.co/t/unable-to-create-ha-with-elasticsearch-with-2-master-nodes/185753 "2019-06-14T03:25:48Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Prashant\_Shirsath](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prashant_shirsath/32/46188_2.png) [@Prashant\_Shirsath](https://discuss.elastic.co/u/Prashant_Shirsath)
#### Post date: [June 14, 2019, 3:25am UTC](https://discuss.elastic.co/t/unable-to-create-ha-with-elasticsearch-with-2-master-nodes/185753/1 "2019-06-14T03:25:48Z")

</div>

I am new to ES. I am trying to set up a cluster on the same machine(Windows)  
I have 2 copy of elasticsearch-7.1.1-masterA & elasticsearch-7.1.1-masterB  
I am using basic version of ELK.

elasticsearch-7.1.1-masterA has following config elastisearch.yml

cluster.name: MyCluster  
node.name: master-node-a  
cluster.initial\_master\_nodes: ["master-node-a", "master-node-b"]  
discovery.zen.minimum\_master\_nodes: 1  
node.master: true  
node.data: true  
xpack.security.enabled: true  
xpack.security.transport.ssl.enabled: true  
xpack.security.transport.ssl.verification\_mode: certificate  
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12  
xpack.security.transport.ssl.truststore.path: elastic-certificates.p12

and elasticsearch-7.1.1-masterB has following config in elasticsearch.yml

cluster.name: MyCluster  
node.name: master-node-b  
cluster.initial\_master\_nodes: ["master-node-a", "master-node-b"]  
discovery.zen.minimum\_master\_nodes: 1  
node.master: true  
node.data: true  
xpack.security.enabled: true  
xpack.security.transport.ssl.enabled: true  
xpack.security.transport.ssl.verification\_mode: certificate  
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12  
xpack.security.transport.ssl.truststore.path: elastic-certificates.p12

So I have 2 masters eligible node. When I am starting my cluster both node get connected and one of them is becoming master node.Assume that MasterA has become master node and masterB is master eligible node. When I am stopping MasterA node then I am expecting MasterB should become master node and elastic keep on running, but I get NodeClosedException.

When 2 node cluster is up I also run kibana, but when master node down kibana also started loging expection.

Please help me out how could I test and create 2 or 3 node cluster and test High availability.

---

<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: [June 14, 2019, 4:55am UTC](https://discuss.elastic.co/t/unable-to-create-ha-with-elasticsearch-with-2-master-nodes/185753/2 "2019-06-14T04:55:46Z")

</div>

A 2-node Elasticsearch cluster can never be highly available as Elasticsearch relies on consensus and requires a majority of master eligible nodes to be present in order to function (majority of 2 is 2). You therefore need to add a master eligible node to the cluster.

---

<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: [July 12, 2019, 4:55am UTC](https://discuss.elastic.co/t/unable-to-create-ha-with-elasticsearch-with-2-master-nodes/185753/3 "2019-07-12T04:55:49Z")

</div>

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