# Master not discovered or elected yet, an election requires a node with id

**URL:** <https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-an-election-requires-a-node-with-id/186704>\
**Category:** Elasticsearch\
**Created:** [June 20, 2019, 2:09pm UTC](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-an-election-requires-a-node-with-id/186704 "2019-06-20T14:09:34Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![SukeshGupta](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@SukeshGupta](https://discuss.elastic.co/u/SukeshGupta)\
**Post date:** [June 20, 2019, 2:09pm UTC](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-an-election-requires-a-node-with-id/186704/1 "2019-06-20T14:09:34Z")

</div>

Hi,

version: 7.0.1  
I have 2 nodes in my local with the following configuration:  
First one yml details :  
node.max\_local\_storage\_nodes: 10  
node.name: node-1  
node.data: true  
node.master: true  
transport.tcp.port: 9305  
transport.publish\_port: 9305  
discovery.seed\_hosts: ["node-1:9305", "node-2:9305"]

second one yml details :  
node.max\_local\_storage\_nodes: 10  
http.port: 9201  
node.name: node-2  
node.data: true  
node.master: true  
transport.tcp.port: 9300  
transport.publish\_port: 9300  
discovery.seed\_hosts: ["node-1:9300", "node-2:9300"]

when i start first node with localhost:9200 its working fine.  
when i start the second node its showing the below error and first node is working fine

master not discovered or elected yet, an election requires a node with id [C84W6hvTT3uX-lz0IAmhhA], have discovered which is not a quorum; discovery will continue using [172.23.249.2:9300, 172.23.249.3:9300] from hosts providers and [{node-2}{tZ1lBzg3SMeYtFK4oo09Ww}{UbiDQC2OQ5GV0RSjDw\_5og}{127.0.0.1}{127.0.0.1:9300}{ml.machine\_memory=8468369408, xpack.installed=true, ml.max\_open\_jobs=20}] from last-known cluster state; node term 30, last-accepted version 472 in term 30

Please tell the reason for the above error. I also want to why we need node.max\_local\_storage\_nodes and what is the use of transport.tcp.port: 9300  
& transport.publish\_port: 9300. Thanks!

---

<div class="post-metadata">

**Author:** ![wangqinghuan](https://avatars.discourse-cdn.com/v4/letter/w/d26b3c/32.png) [@wangqinghuan](https://discuss.elastic.co/u/wangqinghuan)\
**Post date:** [June 22, 2019, 7:18am UTC](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-an-election-requires-a-node-with-id/186704/2 "2019-06-22T07:18:14Z")

</div>

You should contain all master-eligible nodes in discovery.seed\_hosts. In your example, it's

> discovery.seed\_hosts: ["node-1:9305", "node-2:9300"]

---

<div class="post-metadata">

**Author:** ![SukeshGupta](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@SukeshGupta](https://discuss.elastic.co/u/SukeshGupta)\
**Post date:** [June 22, 2019, 9:44am UTC](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-an-election-requires-a-node-with-id/186704/3 "2019-06-22T09:44:12Z")

</div>

Thanks for your reply wang.

I have changed the yml configuration in my local like below now :

First Node yml details :  
http.port : 9200  
node.name: node-1  
network.host : 10.65.32.206  
network.publish\_host: 10.65.32.206  
node.data: true  
node.master: true  
transport.tcp.port: 9305  
transport.publish\_port: 9305  
discovery.seed\_hosts: ["10.65.32.206:9305", "10.65.32.206:9300"]  
cluster.name : eslocal

Second node yml details :  
http.port: 9201  
node.name: node-2  
network.host : 10.65.32.206  
network.publish\_host: 10.65.32.206  
node.master: true  
node.data: true  
transport.tcp.port: 9300  
transport.publish\_port: 9300  
discovery.seed\_hosts: ["10.65.32.206:9305", "10.65.32.206:9300"]  
cluster.name : eslocal

Now 2 nodes are up and running fine. But when i stop the first node in the second node im getting the same error like below :

org.elasticsearch.transport.ConnectTransportException: [node-1][10.65.32.206:9305] connect\_exception  
at org.elasticsearch.transport.TcpTransport$ChannelsConnectedListener.onFailure(TcpTransport.java:1299) ~[elasticsearch-7.0.1.jar:7.0.1]  
at org.elasticsearch.action.ActionListener.lambda$toBiConsumer$2(ActionListener.java:99) ~[elasticsearch-7.0.1.jar:7.0.1]  
at org.elasticsearch.common.concurrent.CompletableContext.lambda$addListener$0(CompletableContext.java:42) ~[elasticsearch-core-7.0.1.jar:7.0.1]  
at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859) ~[?:?]  
at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837) ~[?:?]  
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506) ~[?:?]  
at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2159) ~[?:?]  
at org.elasticsearch.common.concurrent.CompletableContext.completeExceptionally(CompletableContext.java:57) ~[elasticsearch-core-7.0.1.jar:7.0.1]  
at org.elasticsearch.transport.netty4.Netty4TcpChannel.lambda$new$1(Netty4TcpChannel.java:72) ~[?:?]  
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:511) ~[?:?]  
at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:504) ~[?:?]  
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:483) ~[?:?]  
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:424) ~[?:?]  
at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:121) ~[?:?]  
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(AbstractNioChannel.java:327) ~[?:?]  
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:343) ~[?:?]  
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644) ~[?:?]  
at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:556) ~[?:?]  
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:510) ~[?:?]  
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:470) ~[?:?]  
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:909) ~[?:?]  
at java.lang.Thread.run(Thread.java:835) [?:?]  
Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: 10.65.32.206/10.65.32.206:9305  
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[?:?]  
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:779) ~[?:?]  
at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:327) ~[?:?]  
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:340) ~[?:?]  
... 6 more  
Caused by: java.net.ConnectException: Connection refused: no further information  
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[?:?]  
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:779) ~[?:?]  
at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:327) ~[?:?]  
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:340) ~[?:?]  
... 6 more  
[2019-06-22T15:08:20,988][WARN][o.e.c.c.ClusterFormationFailureHelper] [node-2] master not discovered or elected yet, an election requires a node with id [C84W6hvTT3uX-lz0IAmhhA], have discovered which is not a quorum; discovery will continue using [10.65.32.206:9305] from hosts providers and [{node-1}{C84W6hvTT3uX-lz0IAmhhA}{vGP6IBDCR1yxeko5W65ElQ}{10.65.32.206}{10.65.32.206:9305}{ml.machine\_memory=8468365312, ml.max\_open\_jobs=20, xpack.installed=true}, {node-2}{tZ1lBzg3SMeYtFK4oo09Ww}{yDstkyZ6QXWHI-xmt0XvvA}{10.65.32.206}{10.65.32.206:9300}{ml.machine\_memory=8468365312, xpack.installed=true, ml.max\_open\_jobs=20}] from last-known cluster state; node term 57, last-accepted version 930 in term 57

Requesting you to please help me on this. 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:** [June 22, 2019, 11:40am UTC](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-an-election-requires-a-node-with-id/186704/4 "2019-06-22T11:40:59Z")

</div>

> [@SukeshGupta](#):
>
> when i stop the first node in the second node im getting the same error like below :

That looks like the expected behaviour. If you want the cluster to keep on working when you stop a node then you need at least 3 nodes.

---

<div class="post-metadata">

**Author:** ![SukeshGupta](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@SukeshGupta](https://discuss.elastic.co/u/SukeshGupta)\
**Post date:** [June 22, 2019, 6:01pm UTC](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-an-election-requires-a-node-with-id/186704/5 "2019-06-22T18:01:23Z")

</div>

Thanks for your reply David.

Q1:Is this the new change from 7.0.1 version that we need 3 nodes to keep the cluster working if any one of node goes down ?

Because previously I have installed 6.2 version 2 node cluster in 2 different servers and it was working fine if any one of the node goes down.

Q2 : I have installed 2 nodes on my local so it is not working? Is it I have to install in 2 different servers to work properly if any one of the node goes down for 2 node cluster ?

Requesting you to please clarify the above questions.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:** [June 22, 2019, 6:40pm UTC](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-an-election-requires-a-node-with-id/186704/6 "2019-06-22T18:40:55Z")

</div>

> [@SukeshGupta](#):
>
> Is this the new change from 7.0.1 version

No, this constraint is a fundamental property of distributed systems and is not something that Elasticsearch can change. It is mentioned in the documentation for every version since [this section of the manual for 1.4](https://www.elastic.co/guide/en/elasticsearch/reference/1.4/modules-discovery-zen.html#master-election). Before 7.0 it was possible to misconfigure a 2-node cluster as you describe, seriously risking data loss, but this bug is fixed in 7.0.

> [@SukeshGupta](#):
>
> Is it I have to install in 2 different servers to work properly

It depends what you mean by "work properly". If you put all your nodes on a single server and then that server suffers a hardware failure then of course your cluster will stop working.

---

<div class="post-metadata">

**Author:** ![SukeshGupta](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@SukeshGupta](https://discuss.elastic.co/u/SukeshGupta)\
**Post date:** [June 24, 2019, 4:34am UTC](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-an-election-requires-a-node-with-id/186704/7 "2019-06-24T04:34:22Z")

</div>

Thanks for your reply david.

Work properly means if i have 2 node cluster and if one of the node goes down the second node should work fine. So is this possible if have installed 2 nodes on 2 different servers. Right now i have installed 2 nodes on my local.  
I have installed 2 nodes on my local so because of this am i facing this issue(means if one goes down the second will throw an error as "master not discovered or elected yet") .

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:** [June 24, 2019, 6:39am UTC](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-an-election-requires-a-node-with-id/186704/8 "2019-06-24T06:39:09Z")

</div>

> [@SukeshGupta](#):
>
> Work properly means if i have 2 node cluster and if one of the node goes down the second node should work fine.

No, this is not possible. For this you need at least three nodes, no matter where they are running. They can all run on a single server if you want.

---

<div class="post-metadata">

**Author:** ![SukeshGupta](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@SukeshGupta](https://discuss.elastic.co/u/SukeshGupta)\
**Post date:** [June 24, 2019, 7:04am UTC](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-an-election-requires-a-node-with-id/186704/9 "2019-06-24T07:04:19Z")

</div>

Okay David. Thanks for your quick reply. I will try adding one more node.

---

<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 22, 2019, 7:04am UTC](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-an-election-requires-a-node-with-id/186704/10 "2019-07-22T07:04:23Z")

</div>

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