# Getting "master not discovered or elected yet, an election requires at least 2 nodes" after enabling SSL/HTTPS

**URL:** <https://discuss.elastic.co/t/getting-master-not-discovered-or-elected-yet-an-election-requires-at-least-2-nodes-after-enabling-ssl-https/296950>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [February 11, 2022, 8:42am UTC](https://discuss.elastic.co/t/getting-master-not-discovered-or-elected-yet-an-election-requires-at-least-2-nodes-after-enabling-ssl-https/296950 "2022-02-11T08:42:42Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![cgnusr01](https://avatars.discourse-cdn.com/v4/letter/c/8797f3/32.png) [@cgnusr01](https://discuss.elastic.co/u/cgnusr01)\
**Post date:** [February 11, 2022, 8:42am UTC](https://discuss.elastic.co/t/getting-master-not-discovered-or-elected-yet-an-election-requires-at-least-2-nodes-after-enabling-ssl-https/296950/1 "2022-02-11T08:42:42Z")

</div>

I recently upgraded Elastic from version: 7.2 to version 7.16.1 with a rolling update and there were no problems. After some time and after following the instructions here: [Set up basic security for the Elastic Stack | Elasticsearch Guide [8.0] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-basic-setup.html#encrypt-internode-communication), I get the following error:

`2022-02-10T10:41:12,348][WARN][o.e.c.c.ClusterFormationFailureHelper] [es-node-1] master not discovered or elected yet, an election requires at least 2 nodes with ids from [ti0MftEaQk2lV0VMglBfTA, RampKFimRgqlgb09m-ZapA, k0-c9tKzRIeKWgxBioADnA], have only discovered non-quorum [{es-node-1}{RampKFimRgqlgb09m-ZapA}{ok6IkBWXScOUofCKJKkMpw}{10.128.162.21}{10.128.162.21:9300}{cdfhilmrstw}]; discovery will continue using [172.28.162.22:9300, 172.28.162.23:9300] from hosts providers and [{es-node-1}{RampKFimRgqlgb09m-ZapA}{ok6IkBWXScOUofCKJKkMpw}{10.128.162.21}{10.128.162.21:9300}{cdfhilmrstw}] from last-known cluster state; node term 52, last-accepted version 12542592 in term 45`

The `elasticsearch.yml` of the first Master node is: [Master node's elasticsearch config · GitHub](https://gist.github.com/kmandalas/f66d51c3964adabf48312377d1c825d9)

There are two (2) other Master nodes with the same configuration (excepting of course the IPs of the nodes).

---

<div class="post-metadata">

**Author:** ![mverbeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mverbeek/32/101709_2.png) [@mverbeek](https://discuss.elastic.co/u/mverbeek)\
**Post date:** [February 11, 2022, 8:57am UTC](https://discuss.elastic.co/t/getting-master-not-discovered-or-elected-yet-an-election-requires-at-least-2-nodes-after-enabling-ssl-https/296950/2 "2022-02-11T08:57:51Z")

</div>

Might be a configuration error, can you share your Elasticsearch.yml?

---

<div class="post-metadata">

**Author:** ![can.ozdemir](https://avatars.discourse-cdn.com/v4/letter/c/898d66/32.png) [@can.ozdemir](https://discuss.elastic.co/u/can.ozdemir)\
**Post date:** [February 11, 2022, 8:58am UTC](https://discuss.elastic.co/t/getting-master-not-discovered-or-elected-yet-an-election-requires-at-least-2-nodes-after-enabling-ssl-https/296950/3 "2022-02-11T08:58:37Z")

</div>

You are following the 8.0 documentation, there are some changes on security in 8.0 try following a documentation for 7.x

---

<div class="post-metadata">

**Author:** ![cgnusr01](https://avatars.discourse-cdn.com/v4/letter/c/8797f3/32.png) [@cgnusr01](https://discuss.elastic.co/u/cgnusr01)\
**Post date:** [February 11, 2022, 9:04am UTC](https://discuss.elastic.co/t/getting-master-not-discovered-or-elected-yet-an-election-requires-at-least-2-nodes-after-enabling-ssl-https/296950/4 "2022-02-11T09:04:15Z")

</div>

@can.ozdemir Until yesterday, this URL was pointing to 7.16.x - so we followed the 7.16.x instructions

---

<div class="post-metadata">

**Author:** ![cgnusr01](https://avatars.discourse-cdn.com/v4/letter/c/8797f3/32.png) [@cgnusr01](https://discuss.elastic.co/u/cgnusr01)\
**Post date:** [February 11, 2022, 9:12am UTC](https://discuss.elastic.co/t/getting-master-not-discovered-or-elected-yet-an-election-requires-at-least-2-nodes-after-enabling-ssl-https/296950/5 "2022-02-11T09:12:56Z")

</div>

@mverbeek hi Marc, I uploaded the settings in a gist: [Cluster Settings · GitHub](https://gist.github.com/kmandalas/f66d51c3964adabf48312377d1c825d9)

---

<div class="post-metadata">

**Author:** ![mverbeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mverbeek/32/101709_2.png) [@mverbeek](https://discuss.elastic.co/u/mverbeek)\
**Post date:** [February 11, 2022, 9:18am UTC](https://discuss.elastic.co/t/getting-master-not-discovered-or-elected-yet-an-election-requires-at-least-2-nodes-after-enabling-ssl-https/296950/6 "2022-02-11T09:18:15Z")

</div>

To get the simple things out of the way first, have you checked if the nodes can talk with each other and are not blocked by something like a firewall?

Your Elasticsearch.yml looks fine as it is, along as you have at least one other node also defined as master

---

<div class="post-metadata">

**Author:** ![cgnusr01](https://avatars.discourse-cdn.com/v4/letter/c/8797f3/32.png) [@cgnusr01](https://discuss.elastic.co/u/cgnusr01)\
**Post date:** [February 11, 2022, 9:23am UTC](https://discuss.elastic.co/t/getting-master-not-discovered-or-elected-yet-an-election-requires-at-least-2-nodes-after-enabling-ssl-https/296950/7 "2022-02-11T09:23:33Z")

</div>

@mverbeek until yesterday the cluster was fine, running on recently upgraded version 7.16.1 for at least one week. When we tried to enable Security and restarted it, then we run into this problem. Do you think that maybe the `discovery.zen` settings might be responsible somehow?

---

<div class="post-metadata">

**Author:** ![mverbeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mverbeek/32/101709_2.png) [@mverbeek](https://discuss.elastic.co/u/mverbeek)\
**Post date:** [February 11, 2022, 9:30am UTC](https://discuss.elastic.co/t/getting-master-not-discovered-or-elected-yet-an-election-requires-at-least-2-nodes-after-enabling-ssl-https/296950/8 "2022-02-11T09:30:48Z")

</div>

```auto
discovery.zen.ping.unicast.hosts:

```

Is an outdated setting see [Discovery and cluster formation settings | Elasticsearch Guide [7.17] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/modules-discovery-settings.html)  
Try:

```auto
discovery.seed_hosts:

```

Probably also counts for:

```auto
discovery.zen.minimum_master_nodes: 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:** [February 13, 2022, 10:21am UTC](https://discuss.elastic.co/t/getting-master-not-discovered-or-elected-yet-an-election-requires-at-least-2-nodes-after-enabling-ssl-https/296950/11 "2022-02-13T10:21:27Z")

</div>

> [@cgnusr01](#):
>
> @DavidTurner could you please also advise?

It's quite impolite to ping other people to draw them into a conversation in which they have not already engaged. Please don't do that. We're all just volunteers here, we unfortunately can't answer every question.

---

<div class="post-metadata">

**Author:** ![cgnusr01](https://avatars.discourse-cdn.com/v4/letter/c/8797f3/32.png) [@cgnusr01](https://discuss.elastic.co/u/cgnusr01)\
**Post date:** [February 15, 2022, 5:13pm UTC](https://discuss.elastic.co/t/getting-master-not-discovered-or-elected-yet-an-election-requires-at-least-2-nodes-after-enabling-ssl-https/296950/12 "2022-02-15T17:13:37Z")

</div>

@mverbeek after replacing `discovery.zen` settings with `discovery.seed_hosts` and specifying there specific network interfaces (the nodes have multiple network interfaces), the problem seems to be corrected and the cluster after some time when to status GREEN.

---

<div class="post-metadata">

**Author:** ![mverbeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mverbeek/32/101709_2.png) [@mverbeek](https://discuss.elastic.co/u/mverbeek)\
**Post date:** [February 16, 2022, 8:11am UTC](https://discuss.elastic.co/t/getting-master-not-discovered-or-elected-yet-an-election-requires-at-least-2-nodes-after-enabling-ssl-https/296950/13 "2022-02-16T08:11:54Z")

</div>

Good to hear.

---

<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 16, 2022, 8:12am UTC](https://discuss.elastic.co/t/getting-master-not-discovered-or-elected-yet-an-election-requires-at-least-2-nodes-after-enabling-ssl-https/296950/14 "2022-03-16T08:12:26Z")

</div>

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