@leandrojmp I'm not quite sure what you mean by that. I edited the file multiple times by hand before even starting to enroll the second node. The first node is a lab machine that has been running for quite some time now. I did restart elasticsearch multiple times during the process of enrolling the second node and I always created a new enrollment token afterwards.
Yeah, I asked because if I'm not wrong the enrollment-token only works if the first node has been configured using the Auto-configuration process.
But looking at the elasticsearch.yml file that you shared, it seems that it was indeed configured using the auto-configuration process.
I'm not sure what exactly is the issue here, you seem to have followed the documentation, I've never used this enrollment process as I prefer to manually configure everything.
In short if you use enrollment token / auto config do not touch anything
If you want to use manual then you need to set up everything matching...
from the Docs
Node name formats must match
The node names used in the cluster.initial_master_nodes list must exactly match the node.name properties of the nodes. By default the node name is set to the machine’s hostname which may or may not be fully-qualified depending on your system configuration. If each node name is a fully-qualified domain name such as master-a.example.com then you must use fully-qualified domain names in the cluster.initial_master_nodes list too; conversely if your node names are bare hostnames (without the .example.com suffix) then you must use bare hostnames in the cluster.initial_master_nodes list. If you use a mix of fully-qualified and bare hostnames, or there is some other mismatch between node.name and cluster.initial_master_nodes, then the cluster will not form successfully and you will see log messages like the following.
[master-a.example.com] master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes [master-a, master-b] to bootstrap a cluster: have discovered [{master-b.example.com}{...
This message shows the node names master-a.example.com and master-b.example.com as well as the cluster.initial_master_nodes entries master-a and master-b, and it is clear from this message that they do not match exactly.
Look at your error message it is speaking directly to this....
You anonymize the logs so it does not look as clear to us.
[2025-03-25T10:21:44,093][INFO ][o.e.c.c.ClusterBootstrapService] [lab-elk-1] this node has not joined a bootstrapped cluster yet;
[cluster.initial_master_nodes] is set to [[master-node-ipv6]]
[2025-03-25T10:21:44,099][INFO ][o.e.c.c.ClusterBootstrapService] [lab-elk-1]
>>>>
skipping cluster bootstrapping as local node does not match bootstrap requirements: [[master-node-ipv6]]
>>>>>
[2025-03-25T10:21:44,913][INFO ][o.e.c.c.JoinHelper ] [lab-elk-1] failed to join {master-node}{QMruOrUFSZS_wCuvsnT8BQ}{89tCkQwiQziGxsFOq_HuCg}
...
After running the enrollment token on the second node, it creates the auto-config section in the .yml file. At the end there is this:
# Allow HTTP API connections from anywhere
# Connections are encrypted and require user authentication
http.host: 0.0.0.0
# Allow other nodes to join the cluster from anywhere
# Connections are encrypted and mutually authenticated
transport.host: 0.0.0.0
Which I changed to:
# Allow HTTP API connections from anywhere
# Connections are encrypted and require user authentication
http.host: ["[second-node-ipv6]"]
# Allow other nodes to join the cluster from anywhere
# Connections are encrypted and mutually authenticated
transport.host: ["[second-node-ipv6]"]
I also added cluster.initial_master_nodes: ["master-node"].
After these changes, I restarted elasticsearch and the node appeared on the master node when running GET _cat/nodes?v in the dev tools.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.