# Master\_not\_discovered\_exception

**URL:** <https://discuss.elastic.co/t/master-not-discovered-exception/300125>\
**Category:** Elasticsearch\
**Created:** [March 20, 2022, 12:06pm UTC](https://discuss.elastic.co/t/master-not-discovered-exception/300125 "2022-03-20T12:06:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kzltp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kzltp/32/100406_2.png) [@kzltp](https://discuss.elastic.co/u/kzltp)\
**Post date:** [March 20, 2022, 12:06pm UTC](https://discuss.elastic.co/t/master-not-discovered-exception/300125/1 "2022-03-20T12:06:04Z")

</div>

Hello Everyone;

I created elastic environment with 4 nodes. 2 nodes set master role other 2 role set data node. When all node was starting everything is okey. but when any master node down, my cluster not working. Other msater node not elected as master.

My cluster configuration

**VPSYSMNGELK01(10.30.40.30)**  
path.data: /usr/share/Elasticsearch/data  
node.roles: [master]  
network.host: 0.0.0.0  
#transport.host: 0.0.0.0  
bootstrap.memory\_lock: true  
cluster.name: MyCluster  
node.name: "[VPSYSMNGELK01.test.com](http://VPSYSMNGELK01.test.com)"  
discovery.seed\_hosts: ["[VPSYSMNGELK01.test.com](http://VPSYSMNGELK01.test.com)", "[VPSYSMNGELK02.test.com](http://VPSYSMNGELK02.test.com)", "[VPSYSMNGELK03.test.com](http://VPSYSMNGELK03.test.com)", "[VPSYSMNGELK04.test.com](http://VPSYSMNGELK04.test.com)"]  
cluster.initial\_master\_nodes: ["[VPSYSMNGELK01.test.com](http://VPSYSMNGELK01.test.com)", "[VPSYSMNGELK02.test.com](http://VPSYSMNGELK02.test.com)"]  
xpack.security.enabled: false

**VPSYSMNGELK02(10.30.40.31)**  
path.data: /usr/share/Elasticsearch/data  
node.roles: [master]  
network.host: 0.0.0.0  
#transport.host: 0.0.0.0  
bootstrap.memory\_lock: true  
cluster.name: MyCluster  
node.name: "[VPSYSMNGELK02.test.com](http://VPSYSMNGELK02.test.com)"  
discovery.seed\_hosts: ["[VPSYSMNGELK01.test.com](http://VPSYSMNGELK01.test.com)", "[VPSYSMNGELK02.test.com](http://VPSYSMNGELK02.test.com)", "[VPSYSMNGELK03.test.com](http://VPSYSMNGELK03.test.com)", "[VPSYSMNGELK04.test.com](http://VPSYSMNGELK04.test.com)"]  
cluster.initial\_master\_nodes: ["[VPSYSMNGELK01.test.com](http://VPSYSMNGELK01.test.com)", "[VPSYSMNGELK02.test.com](http://VPSYSMNGELK02.test.com)"]  
xpack.security.enabled: false

**VPSYSMNGELK03(10.30.40.32)**  
path.data: /usr/share/Elasticsearch/data  
node.roles: [data]  
network.host: 0.0.0.0  
#transport.host: 0.0.0.0  
bootstrap.memory\_lock: true  
cluster.name: MyCluster  
node.name: "[VPSYSMNGELK03.test.com](http://VPSYSMNGELK03.test.com)"  
discovery.seed\_hosts: ["[VPSYSMNGELK01.test.com](http://VPSYSMNGELK01.test.com)", "[VPSYSMNGELK02.test.com](http://VPSYSMNGELK02.test.com)", "[VPSYSMNGELK03.test.com](http://VPSYSMNGELK03.test.com)", "[VPSYSMNGELK04.test.com](http://VPSYSMNGELK04.test.com)"]  
cluster.initial\_master\_nodes: ["[VPSYSMNGELK01.test.com](http://VPSYSMNGELK01.test.com)", "[VPSYSMNGELK02.test.com](http://VPSYSMNGELK02.test.com)"]  
xpack.security.enabled: false

**VPSYSMNGELK04(10.30.40.33)**  
path.data: /usr/share/Elasticsearch/data  
node.roles: [data]  
network.host: 0.0.0.0  
#transport.host: 0.0.0.0  
bootstrap.memory\_lock: true  
cluster.name: MyCluster  
node.name: "[VPSYSMNGELK04.test.com](http://VPSYSMNGELK04.test.com)"  
discovery.seed\_hosts: ["[VPSYSMNGELK01.test.com](http://VPSYSMNGELK01.test.com)", "[VPSYSMNGELK02.test.com](http://VPSYSMNGELK02.test.com)", "[VPSYSMNGELK03.test.com](http://VPSYSMNGELK03.test.com)", "[VPSYSMNGELK04.test.com](http://VPSYSMNGELK04.test.com)"]  
cluster.initial\_master\_nodes: ["[VPSYSMNGELK01.test.com](http://VPSYSMNGELK01.test.com)", "[VPSYSMNGELK02.test.com](http://VPSYSMNGELK02.test.com)"]  
xpack.security.enabled: false

When every node start;

 ![Screenshot_1](https://us1.discourse-cdn.com/elastic/original/3X/0/f/0fad02629bf3bcbee34128f12b11d8e85abd6422.png)

When stop VPSYSMNGELK01 master node cluster get faild;

```auto
[2022-03-20T15:03:07,093][INFO][o.e.c.c.Coordinator] [VPSYSMNGELK02.test.com] master node [{VPSYSMNGELK01.test.com}{RA4OtAorQpiwcs5WCI6r1Q}{GI_aBd_YSi-Ere_kvLZ_yw}{10.30.40.30}{10.30.40.30:9300}{m}] disconnected, restarting discovery
[2022-03-20T15:03:07,097][INFO][o.e.c.s.ClusterApplierService] [VPSYSMNGELK02.test.com] master node changed {previous [{VPSYSMNGELK01.test.com}{RA4OtAorQpiwcs5WCI6r1Q}{GI_aBd_YSi-Ere_kvLZ_yw}{10.30.40.30}{10.30.40.30:9300}{m}], current []}, term: 12, version: 343, reason: becoming candidate: onLeaderFailure
[2022-03-20T15:03:07,104][WARN][o.e.c.NodeConnectionsService] [VPSYSMNGELK02.test.com] failed to connect to {VPSYSMNGELK01.test.com}{RA4OtAorQpiwcs5WCI6r1Q}{GI_aBd_YSi-Ere_kvLZ_yw}{10.30.40.30}{10.30.40.30:9300}{m}{xpack.installed=true} (tried [1] times)
org.elasticsearch.transport.ConnectTransportException: [VPSYSMNGELK01.test.com][10.30.40.30:9300] connect_exception
        at org.elasticsearch.transport.TcpTransport$ChannelsConnectedListener.onFailure(TcpTransport.java:1107) ~[elasticsearch-8.1.0.jar:8.1.0]
        at org.elasticsearch.action.ActionListener.lambda$toBiConsumer$0(ActionListener.java:279) ~[elasticsearch-8.1.0.jar:8.1.0]
        at org.elasticsearch.core.CompletableContext.lambda$addListener$0(CompletableContext.java:31) ~[elasticsearch-core-8.1.0.jar:8.1.0]
        at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863) ~[?:?]
        at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841) ~[?:?]
        at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) ~[?:?]
        at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2162) ~[?:?]
        at org.elasticsearch.core.CompletableContext.completeExceptionally(CompletableContext.java:46) ~[elasticsearch-core-8.1.0.jar:8.1.0]
        at org.elasticsearch.transport.netty4.Netty4TcpChannel.lambda$addListener$0(Netty4TcpChannel.java:63) ~[?:?]
        at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:578) ~[?:?]
        at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:571) ~[?:?]
        at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:550) ~[?:?]
        at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:491) ~[?:?]
        at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:616) ~[?:?]
        at io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:609) ~[?:?]
        at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:117) ~[?:?]
        at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(AbstractNioChannel.java:321) ~[?:?]
        at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:337) ~[?:?]
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:710) ~[?:?]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:623) ~[?:?]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:586) ~[?:?]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) ~[?:?]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) ~[?:?]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[?:?]
        at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: 10.30.40.30/10.30.40.30:9300
Caused by: java.net.ConnectException: Connection refused
        at sun.nio.ch.Net.pollConnect(Native Method) ~[?:?]
        at sun.nio.ch.Net.pollConnectNow(Net.java:672) ~[?:?]
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:946) ~[?:?]
        at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:330) ~[?:?]
        at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:334) ~[?:?]
        ... 7 more
[2022-03-20T15:03:17,103][WARN][o.e.c.c.ClusterFormationFailureHelper] [VPSYSMNGELK02.test.com] master not discovered or elected yet, an election requires a node with id [RA4OtAorQpiwcs5WCI6r1Q], have only discovered non-quorum [{VPSYSMNGELK02.test.com}{DJf3OpY6RaepLMJHKpSwSA}{JEOLyTh5QNWaSmaV8Phn7w}{10.30.40.31}{10.30.40.31:9300}{m}]; discovery will continue using [10.30.40.30:9300, 10.30.40.32:9300, 10.30.40.33:9300] from hosts providers and [{VPSYSMNGELK01.test.com}{RA4OtAorQpiwcs5WCI6r1Q}{GI_aBd_YSi-Ere_kvLZ_yw}{10.30.40.30}{10.30.40.30:9300}{m}, {VPSYSMNGELK02.test.com}{DJf3OpY6RaepLMJHKpSwSA}{JEOLyTh5QNWaSmaV8Phn7w}{10.30.40.31}{10.30.40.31:9300}{m}] from last-known cluster state; node term 12, last-accepted version 343 in term 12
[2022-03-20T15:03:27,106][WARN][o.e.c.c.ClusterFormationFailureHelper] [VPSYSMNGELK02.test.com] master not discovered or elected yet, an election requires a node with id [RA4OtAorQpiwcs5WCI6r1Q], have only discovered non-quorum [{VPSYSMNGELK02.test.com}{DJf3OpY6RaepLMJHKpSwSA}{JEOLyTh5QNWaSmaV8Phn7w}{10.30.40.31}{10.30.40.31:9300}{m}]; discovery will continue using [10.30.40.30:9300, 10.30.40.32:9300, 10.30.40.33:9300] from hosts providers and [{VPSYSMNGELK01.test.com}{RA4OtAorQpiwcs5WCI6r1Q}{GI_aBd_YSi-Ere_kvLZ_yw}{10.30.40.30}{10.30.40.30:9300}{m}, {VPSYSMNGELK02.test.com}{DJf3OpY6RaepLMJHKpSwSA}{JEOLyTh5QNWaSmaV8Phn7w}{10.30.40.31}{10.30.40.31:9300}{m}] from last-known cluster state; node term 12, last-accepted version 343 in term 12
[2022-03-20T15:03:37,113][WARN][o.e.c.c.ClusterFormationFailureHelper] [VPSYSMNGELK02.test.com] master not discovered or elected yet, an election requires a node with id [RA4OtAorQpiwcs5WCI6r1Q], have only discovered non-quorum [{VPSYSMNGELK02.test.com}{DJf3OpY6RaepLMJHKpSwSA}{JEOLyTh5QNWaSmaV8Phn7w}{10.30.40.31}{10.30.40.31:9300}{m}]; discovery will continue using [10.30.40.30:9300, 10.30.40.32:9300, 10.30.40.33:9300] from hosts providers and [{VPSYSMNGELK01.test.com}{RA4OtAorQpiwcs5WCI6r1Q}{GI_aBd_YSi-Ere_kvLZ_yw}{10.30.40.30}{10.30.40.30:9300}{m}, {VPSYSMNGELK02.test.com}{DJf3OpY6RaepLMJHKpSwSA}{JEOLyTh5QNWaSmaV8Phn7w}{10.30.40.31}{10.30.40.31:9300}{m}] from last-known cluster state; node term 12, last-accepted version 343 in term 12
root@VPSYSMNGELK02:/home/arif#

```

Could you help me to solve the problem?

---

<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:** [March 20, 2022, 12:10pm UTC](https://discuss.elastic.co/t/master-not-discovered-exception/300125/2 "2022-03-20T12:10:39Z")

</div>

Elasticsearch always requires a strict majority of master eligible nodes to be available in order to elect a master, so with only 2 master eligible nodes both have to be avaiable (strict majority of 2 is 2) for the cluster to function properly. This is why 3 master eligible nodes is reconmmended, as the majority of 3 is 2 and one node can go down without affecting the cluster. Have a look at [this section in the docs](https://www.elastic.co/guide/en/elasticsearch/reference/8.1/high-availability-cluster-small-clusters.html) for further details. For small clusters it is common to have 3 nodes that hold data and all are master eligible.

---

<div class="post-metadata">

**Author:** ![kzltp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kzltp/32/100406_2.png) [@kzltp](https://discuss.elastic.co/u/kzltp)\
**Post date:** [March 20, 2022, 12:25pm UTC](https://discuss.elastic.co/t/master-not-discovered-exception/300125/3 "2022-03-20T12:25:24Z")

</div>

You are superman. Thanks a lot your support. I added one more master. My cluster work.

---

<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 17, 2022, 12:25pm UTC](https://discuss.elastic.co/t/master-not-discovered-exception/300125/4 "2022-04-17T12:25:45Z")

</div>

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