Cluster bootstrap settings control how a brand-new Elasticsearch cluster elects its first master and commits its first cluster UUID. Setting the initial voting configuration correctly prevents fresh nodes from forming separate clusters during the first startup window.
Self-managed Elasticsearch forms clusters over the transport layer on port 9300. The discovery.seed_hosts setting tells each node where to find master-eligible peers, while cluster.initial_master_nodes defines which master-eligible node.name values are allowed to vote in the first election.
Automatic bootstrapping is only for development mode. In production, configure cluster.initial_master_nodes only on the master-eligible nodes that are forming a brand-new cluster, remove it from their configuration after the cluster forms, and never add it to nodes joining an existing cluster, nodes that are restarting, or a full-cluster restart.
$ sudo nano /etc/elasticsearch/elasticsearch.yml
cluster.name: search-cluster node.name: es-master-a
The cluster.initial_master_nodes list must match the final node.name values exactly. If node.name uses FQDNs, use the same FQDNs in the bootstrap list.
discovery.seed_hosts: - es-master-a:9300 - es-master-b:9300 - es-master-c:9300 cluster.initial_master_nodes: - es-master-a - es-master-b - es-master-c
Keep the cluster.initial_master_nodes list identical on every participating master-eligible node.
Do not configure cluster.initial_master_nodes on master-ineligible nodes, on nodes joining an existing cluster, or during a full-cluster restart.
Use resolvable DNS names or reachable IP addresses in discovery.seed_hosts. If the port is omitted, Elasticsearch uses the transport port, usually 9300.
$ sudo systemctl start elasticsearch
If a node already belongs to an existing cluster, stop and remove the bootstrap setting instead of starting it with a new cluster.initial_master_nodes list.
$ curl -sS "http://localhost:9200/_cluster/health?wait_for_nodes=>=3&timeout=60s&filter_path=cluster_name,status,timed_out,number_of_nodes&pretty"
{
"cluster_name" : "search-cluster",
"status" : "green",
"timed_out" : false,
"number_of_nodes" : 3
}
number_of_nodes and timed_out confirm discovery more directly than the health color. Fresh clusters can briefly report red or yellow while startup tasks finish.
Secured clusters typically use https://host:9200// with a CA file and authentication, for example curl -u elastic "https://localhost:9200/..." or an API key header.</WRAP> - List the nodes to confirm that exactly one node is elected master and that the names match the bootstrap list. <code>$ curl -sS “http://localhost:9200/_cat/nodes?v&h=ip,name,node.role,master” ip name node.role master 172.23.0.4 es-master-c cdfhilmrstw - 172.23.0.3 es-master-b cdfhilmrstw * 172.23.0.2 es-master-a cdfhilmrstw -</code>
A single * in the master column marks the elected master-eligible node.
- Record the committed cluster UUID before cleaning up the bootstrap setting. <code>$ curl -sS “http://localhost:9200/_cluster/state/master_node,metadata?filter_path=master_node,metadata.cluster_uuid&pretty” { “master_node” : “mjQueJ4pT4SdAMcG4RDvTQ”, “metadata” : { “cluster_uuid” : “lr_FqXtWQK6buWOAnp71yg” } }</code>
Use the same query on multiple nodes when needed. Matching cluster_uuid values confirm the nodes joined the same cluster instead of separate bootstrapped islands.
- Remove the cluster.initial_master_nodes block from every participating node after the cluster forms successfully. <file> discovery.seed_hosts: - es-master-a:9300 - es-master-b:9300 - es-master-c:9300 </file>
cluster.initial_master_nodes is a startup-only setting. Remove it from the configuration files and never add it back for this cluster.