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

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, 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

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

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

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

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

@mverbeek hi Marc, I uploaded the settings in a gist: Cluster Settings · GitHub

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

@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?

discovery.zen.ping.unicast.hosts:

Is an outdated setting see Discovery and cluster formation settings | Elasticsearch Guide [7.17] | Elastic
Try:

discovery.seed_hosts:

Probably also counts for:

discovery.zen.minimum_master_nodes: 2

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.

2 Likes

@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.

Good to hear.

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