Simple example of new configuration of three node cluster, since v7.x update uses new settings

Hi, I took the Elasticsearch Engineer 1 training this summer (ES 6.x), then completed the Engineer 2 training (ES 7.x)

Since I learned this the config settings no longer use :

discovery.zen.ping.unicast.hosts: ["server1", "server2", "server3"]
discovery.zen.minimum_master_nodes: 2

and instead use

discovery.seed_hosts: ["server1", "server2", "server3"]    
cluster.initial_master_nodes: ["server1"]

Possible to get a simple example of how servers could join a 3 node cluster in ES 7.x ?

Is the following correct?

First time a "server1" joins a 3 node cluster (server1-3), add this to elasticsearch.yml

discovery.seed_hosts: ["server1", "server2", "server3"]    
cluster.initial_master_nodes: ["server1"]

Then stop server1, delete this line, then restart

cluster.initial_master_nodes: ["server1"]

Repeat for server2 and server 3, ie first time server2 joins:

discovery.seed_hosts: ["server1", "server2", "server3"]    
cluster.initial_master_nodes: ["server2"]

I have been referring to https://www.elastic.co/guide/en/elasticsearch/reference/7.2/discovery-settings.html however would be grateful for a simple example.

Quoting the docs on cluster.initial_master_nodes:

You should not use this setting when restarting a cluster or adding a new node to an existing cluster.

Just set discovery.seed_hosts and do not mention cluster.initial_master_nodes.

1 Like

Thanks David! Indeed you are right about the docs.

I don't understand why in I have seen eg:

cluster.initial_master_nodes: ["node1"]

when configuring a three node cluster (it is in the ES7 webinar for exam prep) and I also have seen it in the labs when using a single node cluster for the first time, or at least that is what I understood.

Right, forming a cluster for the first time is quite different from joining a node to an existing cluster, and is exactly the situation in which you must set cluster.initial_master_nodes. But you must set it to the same value on every node on which it is set. From these docs:

WARNING: You must set cluster.initial_master_nodes to the same list of nodes on each node on which it is set in order to be sure that only a single cluster forms during bootstrapping and therefore to avoid the risk of data loss.

1 Like

Aha! Thanks, now I see they are different scenarios.

I checked with the education team and confirmed that this is something covered in the Elasticsearch Engineer I course for the 7.x series but not in the 6.x course that you attended since it does not apply to 6.x.

1 Like

Thanks, indeed. That is why my Eng 1 lab doesn't make sense when prepping for the exam. I was hoping for a simple or updated example for my exam prep, though your answer points me to where I was getting mixed up, at least in theory :slight_smile:

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