# Master not discovered or elected yet, an election requires 2 nodes with ids

**URL:** <https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-an-election-requires-2-nodes-with-ids/262205>\
**Category:** Elasticsearch\
**Created:** [January 26, 2021, 8:36am UTC](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-an-election-requires-2-nodes-with-ids/262205 "2021-01-26T08:36:20Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![sadff](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@sadff](https://discuss.elastic.co/u/sadff)\
**Post date:** [January 26, 2021, 8:36am UTC](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-an-election-requires-2-nodes-with-ids/262205/1 "2021-01-26T08:36:20Z")

</div>

\*\*config file \*\*

```
version: '2.2'
services:
  es03:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.10.2
    container_name: es03
    environment:
      - node.name=es03
      - network.publish_host=192.168.61.114
      - discovery.seed_hosts=192.168.61.112
      - cluster.initial_master_nodes=192.168.61.112,192.168.61.113,192.168.61.114
      - cluster.name=es-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - data01:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
      - 9300:9300
    networks:
      - elastic
volumes:
  data01:
    driver: local
networks:
  elastic:
    driver: bridge

```

**error log**

master not discovered or elected yet, an election requires 2 nodes with ids

[QhLl9zbgQt6mQku\_yLTqNw, ru42fueKTYWDuaUhgGkXuQ],

have discovered

[{es03}{QhLl9zbgQt6mQku\_yLTqNw}{4U29XGKSQHuayMfLpjH8xw}  
{192.168.61.114}{192.168.61.114:9300}  
{cdhilmrstw}{ml.machine\_memory=2933927936, xpack.installed=true, transform.node=true, ml.max\_open\_jobs=20},

{es01}  
{ru42fueKTYWDuaUhgGkXuQ}{0ASYKum3Sd6P2uWrQbk8uw}  
{192.168.61.112}{192.168.61.112:9300}  
{cdhilmrstw}{ml.machine\_memory=2933927936, ml.max\_open\_jobs=20, xpack.installed=true, transform.node=true},

{es02}  
{mRFp\_9x1T4ea\_2KHEUzdyQ}{fT8zs\_b-SrSRi4Zvum4q0Q}  
{192.168.61.113}{192.168.61.113:9300}  
{cdhilmrstw}{ml.machine\_memory=2933932032, ml.max\_open\_jobs=20, xpack.installed=true, transform.node=true}]

which is a quorum; discovery will continue using

[192.168.61.112:9300, 192.168.61.113:9300]

from hosts providers and

[{es03}{QhLl9zbgQt6mQku\_yLTqNw}{4U29XGKSQHuayMfLpjH8xw}  
{192.168.61.114}{192.168.61.114:9300}  
{cdhilmrstw}{ml.machine\_memory=2933927936, xpack.installed=true, transform.node=true, ml.max\_open\_jobs=20}]

from last-known cluster state; node term 0, last-accepted version 0 in term 0

---

<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:** [January 26, 2021, 9:03am UTC](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-an-election-requires-2-nodes-with-ids/262205/2 "2021-01-26T09:03:20Z")

</div>

Please don't post images of text, they are impossible to search for later and cannot be read by those of us using screen readers (and tbh this one is almost impossible to read even for sighted readers). Instead please share the contents of the logs and config files, formatted using the `</>` button so it looks as you are seeing it.

---

<div class="post-metadata">

**Author:** ![sadff](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@sadff](https://discuss.elastic.co/u/sadff)\
**Post date:** [January 26, 2021, 9:28am UTC](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-an-election-requires-2-nodes-with-ids/262205/3 "2021-01-26T09:28:45Z")

</div>

Is that ok? I tried my best

---

<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:** [January 26, 2021, 9:32am UTC](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-an-election-requires-2-nodes-with-ids/262205/4 "2021-01-26T09:32:56Z")

</div>

It's better, though not perfect. At least I can see it now. Use the `</>` button and check the preview window:

```nohighlight
preformatted text

```

I don't think this message is what Elasticsearch reported, I think you've edited it and now it doesn't make sense. Would you share the actual logs that Elasticsearch reports without editing?

---

<div class="post-metadata">

**Author:** ![sadff](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@sadff](https://discuss.elastic.co/u/sadff)\
**Post date:** [January 26, 2021, 9:36am UTC](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-an-election-requires-2-nodes-with-ids/262205/5 "2021-01-26T09:36:11Z")

</div>

**this is the log**

es01 | {"type": "server", "timestamp": "2021-01-26T09:34:34,972Z", "level": "WARN", "component": "o.e.c.c.ClusterFormationFailureHelper", "cluster.name": "es-cluster", "node.name": "es01", "message": "master not discovered or elected yet, an election requires at least 2 nodes with ids from [bYUUn1SOTpmtXK3NcjEuCw, RKYlzwmcSyyK3YoV8T5YJw, ru42fueKTYWDuaUhgGkXuQ], have discovered [{es01}{ru42fueKTYWDuaUhgGkXuQ}{0ASYKum3Sd6P2uWrQbk8uw}{192.168.61.112}{192.168.61.112:9300}{cdhilmrstw}{ml.machine\_memory=2933927936, xpack.installed=true, transform.node=true, ml.max\_open\_jobs=20}, {es02}{mRFp\_9x1T4ea\_2KHEUzdyQ}{fT8zs\_b-SrSRi4Zvum4q0Q}{192.168.61.113}{192.168.61.113:9300}{cdhilmrstw}{ml.machine\_memory=2933932032, ml.max\_open\_jobs=20, xpack.installed=true, transform.node=true}, {es03}{QhLl9zbgQt6mQku\_yLTqNw}{4U29XGKSQHuayMfLpjH8xw}{192.168.61.114}{192.168.61.114:9300}{cdhilmrstw}{ml.machine\_memory=2933927936, ml.max\_open\_jobs=20, xpack.installed=true, transform.node=true}] which is not a quorum; discovery will continue using [192.168.61.113:9300, 192.168.61.114:9300] from hosts providers and [{es01}{ru42fueKTYWDuaUhgGkXuQ}{0ASYKum3Sd6P2uWrQbk8uw}{192.168.61.112}{192.168.61.112:9300}{cdhilmrstw}{ml.machine\_memory=2933927936, xpack.installed=true, transform.node=true, ml.max\_open\_jobs=20}] from last-known cluster state; node term 2, last-accepted version 58 in term 2" }

---

<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:** [January 26, 2021, 9:40am UTC](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-an-election-requires-2-nodes-with-ids/262205/6 "2021-01-26T09:40:06Z")

</div>

Can you share the same message from the other two nodes as well?

---

<div class="post-metadata">

**Author:** ![sadff](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@sadff](https://discuss.elastic.co/u/sadff)\
**Post date:** [January 26, 2021, 10:05am UTC](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-an-election-requires-2-nodes-with-ids/262205/7 "2021-01-26T10:05:51Z")

</div>

**192.168.61.112 log**

es01 | {"type": "server", "timestamp": "2021-01-26T09:49:15,220Z", "level": "WARN", "component": "o.e.c.c.ClusterFormationFailureHelper", "cluster.name": "es-cluster", "node.name": "es01", "message": "master not discovered or elected yet, an election requires at least 2 nodes with ids from [bYUUn1SOTpmtXK3NcjEuCw, RKYlzwmcSyyK3YoV8T5YJw, ru42fueKTYWDuaUhgGkXuQ], have discovered [{es01}{ru42fueKTYWDuaUhgGkXuQ}{0ASYKum3Sd6P2uWrQbk8uw}{192.168.61.112}{192.168.61.112:9300}{cdhilmrstw}{ml.machine\_memory=2933927936, xpack.installed=true, transform.node=true, ml.max\_open\_jobs=20}, {es02}{mRFp\_9x1T4ea\_2KHEUzdyQ}{fT8zs\_b-SrSRi4Zvum4q0Q}{192.168.61.113}{192.168.61.113:9300}{cdhilmrstw}{ml.machine\_memory=2933932032, ml.max\_open\_jobs=20, xpack.installed=true, transform.node=true}, {es03}{QhLl9zbgQt6mQku\_yLTqNw}{4U29XGKSQHuayMfLpjH8xw}{192.168.61.114}{192.168.61.114:9300}{cdhilmrstw}{ml.machine\_memory=2933927936, ml.max\_open\_jobs=20, xpack.installed=true, transform.node=true}] which is not a quorum; discovery will continue using [192.168.61.113:9300, 192.168.61.114:9300] from hosts providers and [{es01}{ru42fueKTYWDuaUhgGkXuQ}{0ASYKum3Sd6P2uWrQbk8uw}{192.168.61.112}{192.168.61.112:9300}{cdhilmrstw}{ml.machine\_memory=2933927936, xpack.installed=true, transform.node=true, ml.max\_open\_jobs=20}] from last-known cluster state; node term 2, last-accepted version 58 in term 2" }

**192.168.61.113 log**

es02 | {"type": "server", "timestamp": "2021-01-26T09:50:08,093Z", "level": "WARN", "component": "o.e.c.c.ClusterFormationFailureHelper", "cluster.name": "es-cluster", "node.name": "es02", "message": "master not discovered or elected yet, an election requires 2 nodes with ids [ru42fueKTYWDuaUhgGkXuQ, mRFp\_9x1T4ea\_2KHEUzdyQ], have discovered [{es02}{mRFp\_9x1T4ea\_2KHEUzdyQ}{fT8zs\_b-SrSRi4Zvum4q0Q}{192.168.61.113}{192.168.61.113:9300}{cdhilmrstw}{ml.machine\_memory=2933932032, xpack.installed=true, transform.node=true, ml.max\_open\_jobs=20}, {es01}{ru42fueKTYWDuaUhgGkXuQ}{0ASYKum3Sd6P2uWrQbk8uw}{192.168.61.112}{192.168.61.112:9300}{cdhilmrstw}{ml.machine\_memory=2933927936, ml.max\_open\_jobs=20, xpack.installed=true, transform.node=true}, {es03}{QhLl9zbgQt6mQku\_yLTqNw}{4U29XGKSQHuayMfLpjH8xw}{192.168.61.114}{192.168.61.114:9300}{cdhilmrstw}{ml.machine\_memory=2933927936, ml.max\_open\_jobs=20, xpack.installed=true, transform.node=true}] which is a quorum; discovery will continue using [192.168.61.112:9300, 192.168.61.114:9300] from hosts providers and [{es02}{mRFp\_9x1T4ea\_2KHEUzdyQ}{fT8zs\_b-SrSRi4Zvum4q0Q}{192.168.61.113}{192.168.61.113:9300}{cdhilmrstw}{ml.machine\_memory=2933932032, xpack.installed=true, transform.node=true, ml.max\_open\_jobs=20}] from last-known cluster state; node term 0, last-accepted version 0 in term 0" }

**192.168.61.114 log**

es03 | {"type": "server", "timestamp": "2021-01-26T09:50:16,411Z", "level": "WARN", "component": "o.e.c.c.ClusterFormationFailureHelper", "cluster.name": "es-cluster", "node.name": "es03", "message": "master not discovered or elected yet, an election requires 2 nodes with ids [QhLl9zbgQt6mQku\_yLTqNw, ru42fueKTYWDuaUhgGkXuQ], have discovered [{es03}{QhLl9zbgQt6mQku\_yLTqNw}{4U29XGKSQHuayMfLpjH8xw}{192.168.61.114}{192.168.61.114:9300}{cdhilmrstw}{ml.machine\_memory=2933927936, xpack.installed=true, transform.node=true, ml.max\_open\_jobs=20}, {es01}{ru42fueKTYWDuaUhgGkXuQ}{0ASYKum3Sd6P2uWrQbk8uw}{192.168.61.112}{192.168.61.112:9300}{cdhilmrstw}{ml.machine\_memory=2933927936, ml.max\_open\_jobs=20, xpack.installed=true, transform.node=true}, {es02}{mRFp\_9x1T4ea\_2KHEUzdyQ}{fT8zs\_b-SrSRi4Zvum4q0Q}{192.168.61.113}{192.168.61.113:9300}{cdhilmrstw}{ml.machine\_memory=2933932032, ml.max\_open\_jobs=20, xpack.installed=true, transform.node=true}] which is a quorum; discovery will continue using [192.168.61.112:9300, 192.168.61.113:9300] from hosts providers and [{es03}{QhLl9zbgQt6mQku\_yLTqNw}{4U29XGKSQHuayMfLpjH8xw}{192.168.61.114}{192.168.61.114:9300}{cdhilmrstw}{ml.machine\_memory=2933927936, xpack.installed=true, transform.node=true, ml.max\_open\_jobs=20}] from last-known cluster state; node term 0, last-accepted version 0 in term 0" }

the final question , i know [https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-compose-file](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-compose-file) OK , but how can i replace it with three different host(IP)

---

<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:** [January 26, 2021, 11:18am UTC](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-an-election-requires-2-nodes-with-ids/262205/8 "2021-01-26T11:18:16Z")

</div>

```auto
an election requires at least 2 nodes with ids from [bYUUn1SOTpmtXK3NcjEuCw, RKYlzwmcSyyK3YoV8T5YJw, ru42fueKTYWDuaUhgGkXuQ]
an election requires 2 nodes with ids [ru42fueKTYWDuaUhgGkXuQ, mRFp_9x1T4ea_2KHEUzdyQ]
an election requires 2 nodes with ids [QhLl9zbgQt6mQku_yLTqNw, ru42fueKTYWDuaUhgGkXuQ]

```

I see at least 5 node IDs here, which means either you have 5 nodes or else you have wiped the data paths of some nodes causing them to generate new IDs. If you did lose the contents of the data path then this cluster is broken, the simplest fix is to wipe everything and start from the beginning again.

---

<div class="post-metadata">

**Author:** ![sadff](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@sadff](https://discuss.elastic.co/u/sadff)\
**Post date:** [January 27, 2021, 6:59am UTC](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-an-election-requires-2-nodes-with-ids/262205/9 "2021-01-27T06:59:25Z")

</div>

Thank you for your help. The problem has been solved. I use this command:

`docker system prune --all --force --volumes`

Welcome to China! 🤪

---

<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:** [February 24, 2021, 6:59am UTC](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-an-election-requires-2-nodes-with-ids/262205/10 "2021-02-24T06:59:35Z")

</div>

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