# Nodes not syncing due to: master not discovered or elected yet

**URL:** <https://discuss.elastic.co/t/nodes-not-syncing-due-to-master-not-discovered-or-elected-yet/326434>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [February 24, 2023, 11:26am UTC](https://discuss.elastic.co/t/nodes-not-syncing-due-to-master-not-discovered-or-elected-yet/326434 "2023-02-24T11:26:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![parthmaniar](https://avatars.discourse-cdn.com/v4/letter/p/71e660/32.png) [@parthmaniar](https://discuss.elastic.co/u/parthmaniar)\
**Post date:** [February 24, 2023, 11:26am UTC](https://discuss.elastic.co/t/nodes-not-syncing-due-to-master-not-discovered-or-elected-yet/326434/1 "2023-02-24T11:26:00Z")

</div>

Hello,

1. I have a 3-node cluster with two nodes holding data and one as the voting node thastorees not hold any data.

2. All virtual nodes run on ESXi 8.0 with Ubuntu 22.04.1 & Elasticsearch 8.6.2.

3. OS and data are on separate SSDs.

4. **One of the data nodes had it's SSD filled & VMWare ESXi was not allowing me to move ahead. Hence I replaced the SSD with an empty one hoping to have the dsuppliedlled from the remaining data node.**

5. After replacing the SSD, formatting it, mounting the volume & applying for the correct owner permissions, I restarted all three nodes. I am, however, getting the following error:

```auto
[2023-02-24T11:09:54,290][WARN][o.e.c.c.ClusterFormationFailureHelper] [primarynode] master not discovered or elected yet, an election requires at least 2 nodes with ids from [1qviKJ0KSfCe8-81Ev_Yhw, bjoclsc8SZSjjwuL0Rd_Jw, LYXT25ZWR5m7mn4uh0bjng], have only discovered non-quorum [{primarynode}{KrXCHV4OReaM1KWYk8kdVg}{jLZx0tVjRful6ARnYgs6UA}{primarynode}{192.168.0.235}{192.168.0.235:9300}{dilmr}, {secondarynode}{1qviKJ0KSfCe8-81Ev_Yhw}{3YrVbixxSg6G5IHgv9NcAA}{secondarynode}{192.168.0.236}{192.168.0.236:9300}{dilmr}]; discovery will continue using [192.168.0.236:9300, 192.168.0.237:9300] from hosts providers and [{primarynode}{KrXCHV4OReaM1KWYk8kdVg}{jLZx0tVjRful6ARnYgs6UA}{primarynode}{192.168.0.235}{192.168.0.235:9300}{dilmr}, {secondarynode}{1qviKJ0KSfCe8-81Ev_Yhw}{3YrVbixxSg6G5IHgv9NcAA}{secondarynode}{192.168.0.236}{192.168.0.236:9300}{dilmr}, {votingonlynode}{bjoclsc8SZSjjwuL0Rd_Jw}{RzpWrqWXTfiW3yKtJaS8bg}{votingonlynode}{192.168.0.237}{192.168.0.237:9300}{imrv}] from last-known cluster state; node term 1083, last-accepted version 15142102 in term 1083

```

```auto
[2023-02-24T11:09:56,629][INFO][o.e.x.s.a.RealmsAuthenticator] [primarynode] Authentication of [**redacted**] was terminated by realm [reserved] - failed to authenticate user [elastic]
[2023-02-24T11:09:56,721][INFO][o.e.x.s.a.RealmsAuthenticator] [primarynode] Authentication of [**redacted**] was terminated by realm [reserved] - failed to authenticate user [elastic]

```

Here is the **discovery** portion of my elasticsearch.yml that I reckon requires an edit (referring to this: [Master not discovered or elected yet, an election requires at least 2 nodes - #4 by li-peng](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-an-election-requires-at-least-2-nodes/213412/4))

```auto
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["host1", "host2"]
#discovery.seed_hosts: ["primarynode", "secondarynode"]
#discovery.seed_hosts: ["primarynode", "secondarynode", "votingonlynode"]
discovery.seed_hosts: ["192.168.0.235", "192.168.0.236", "192.168.0.237"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["node-1", "node-2"]
#cluster.initial_master_nodes: ["primarynode", "secondarynode"]

#30-05-2021: Commented as part of diagnostic since the sync was failing. That restore did not work.
#30-05-2021: Removing the comment
#30-05-2021: Needs review - added to tasks
#31-05-2021: Commenting based on: https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-discovery-bootstrap-cluster.html
#-> This setting is only needed to form a cluster.
#cluster.initial_master_nodes: ["192.168.0.235", "192.168.0.236"]

#
# For more information, consult the discovery and cluster formation module documentation.
#

```

How do I resolve the error?

---

<div class="post-metadata">

**Author:** ![parthmaniar](https://avatars.discourse-cdn.com/v4/letter/p/71e660/32.png) [@parthmaniar](https://discuss.elastic.co/u/parthmaniar)\
**Post date:** [February 26, 2023, 6:28am UTC](https://discuss.elastic.co/t/nodes-not-syncing-due-to-master-not-discovered-or-elected-yet/326434/2 "2023-02-26T06:28:02Z")

</div>

The cluster is operational and green. Here is the current discovery set in the `elasticsearch.yml`

**`Primary node:`**

```auto
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["host1", "host2"]
#discovery.seed_hosts: ["primarynode", "secondarynode"]
#discovery.seed_hosts: ["primarynode", "secondarynode", "votingonlynode"]
discovery.seed_hosts: ["192.168.0.235", "192.168.0.236", "192.168.0.237"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["node-1", "node-2"]
#cluster.initial_master_nodes: ["primarynode", "secondarynode"]

#30-05-2021: Commented as part of diagnostic since the sync was failing. That restore did not work.
#30-05-2021: Removing the comment
#30-05-2021: Needs review - added to tasks
#31-05-2021: Commenting based on: https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-discovery-bootstrap-cluster.html
#-> This setting is only needed to form a cluster.
#cluster.initial_master_nodes: ["192.168.0.235", "192.168.0.236"]

#

```

**`Secondary node`**

```auto
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["host1", "host2"]
#discovery.seed_hosts: ["primarynode", "secondarynode"]
#discovery.seed_hosts: ["primarynode", "secondarynode", "votingonlynode"]
discovery.seed_hosts: ["192.168.0.235", "192.168.0.236", "192.168.0.237"]
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["node-1", "node-2"]
#cluster.initial_master_nodes: ["primarynode", "secondarynode"]

#30-05-2021: Commented as part of diagnostic since the sync was failing. That restore did not work.
#30-05-2021: Removing the comment
#30-05-2021: Needs review - added to tasks
#31-05-2021: Commenting based on: https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-discovery-bootstrap-cluster.html
#-> This setting is only needed to form a cluster.
#cluster.initial_master_nodes: ["192.168.0.235", "192.168.0.236"]

#
# For more information, consult the discovery and cluster formation module documentation.
#

```

**`Tertiary node (voting only)`**

```auto
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["host1", "host2"]
#discovery.seed_hosts: ["primarynode", "secondarynode", "votingonlynode"]
discovery.seed_hosts: ["192.168.0.235", "192.168.0.236", "192.168.0.237"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["node-1", "node-2"]
#cluster.initial_master_nodes: ["primarynode", "secondarynode"]

#Commented on 30-05-2021 as part of diagnosing cluster sync failure
#cluster.initial_master_nodes: ["192.168.0.235", "192.168.0.236"]
#
# For more information, consult the discovery and cluster formation module documentation.
#

```

---

<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:** [March 26, 2023, 6:28am UTC](https://discuss.elastic.co/t/nodes-not-syncing-due-to-master-not-discovered-or-elected-yet/326434/3 "2023-03-26T06:28:33Z")

</div>

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