How to configure discovery.zen.minimum_master_nodes for an automated deployment

So I want to automate the deployment of a 3 or 4 node ES cluster.

The discovery.zen.minimum_master_nodes setting for a cluster this size should probably be 3 which is how I want to set it.

Problem is, how do I automate this deployment?

If I set it to "3" out of the gate the nodes will never create a cluster because one does not exist yet.

I need to set it to "1", wait for the nodes to create a cluster and elect a master and then set it to "3". Is this the only way to go about this or I'm I missing something?

Based on es doc the minimum master node should be nodes / 2 + 1, in 3 nodes, it should be 2; that's what I set in my 3 nodes; I tried bring one node down, the cluster is yellow but the total doc returns is the correct total.

I am running es on aws ec2 instance and using cloud formation to bring up ec2 instance and install elasticsearch. (done in shell script to install elasticsearch and plugin and change the configuration)

You set minimum master nodes to 3 from the start. The nodes will start up and ping each other but not elect a master or be part of the cluster until 3 nodes are up. You would set this property in each of the node's elasticsearch.yml file.

1 Like

Cool guess I misunderstood. This makes sense as I was only testing with 2 nodes.