# Need help setting up a second node

**URL:** <https://discuss.elastic.co/t/need-help-setting-up-a-second-node/375785>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [March 12, 2025, 2:14pm UTC](https://discuss.elastic.co/t/need-help-setting-up-a-second-node/375785 "2025-03-12T14:14:59Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 25, 2025, 4:46pm UTC](https://discuss.elastic.co/t/need-help-setting-up-a-second-node/375785/21 "2025-03-25T16:46:28Z")

</div>

> [@hairless\_mess](#):
>
> `#node.name: master-node`

Do not comment this out. It helps to have the node have a known name.

> [@hairless\_mess](#):
>
> `cluster.initial_master_nodes: ["master-node-hostname"]`

This should be the name of the initial master node, not the hostname. Change this to `master-node` once you have uncommented the node name.

> [@hairless\_mess](#):
>
> `http.host: ["[master-node-ipv6]"]`

If the node starts up successfully, check that it binds to the expected IP address. I rarely use ipv6 so am not sure how that is handled.

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [March 25, 2025, 4:47pm UTC](https://discuss.elastic.co/t/need-help-setting-up-a-second-node/375785/22 "2025-03-25T16:47:51Z")

</div>

Quick question, did you edit the `elasticsearch.yml` file manually before starting up the first node?

---

<div class="post-metadata">

**Author:** ![hairless\_mess](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hairless_mess/32/141984_2.png) [@hairless\_mess](https://discuss.elastic.co/u/hairless_mess)\
**Post date:** [March 25, 2025, 4:56pm UTC](https://discuss.elastic.co/t/need-help-setting-up-a-second-node/375785/23 "2025-03-25T16:56:05Z")

</div>

Changing that didn't change anything.

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

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [March 25, 2025, 5:15pm UTC](https://discuss.elastic.co/t/need-help-setting-up-a-second-node/375785/24 "2025-03-25T17:15:44Z")

</div>

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.

Both configurations seems to be correct.

What do you have in the logs of both nodes?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [March 25, 2025, 6:00pm UTC](https://discuss.elastic.co/t/need-help-setting-up-a-second-node/375785/25 "2025-03-25T18:00:05Z")

</div>

> **[Important Elasticsearch configuration | Elasticsearch Guide \[8.17\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/8.17/important-settings.html#initial_master_nodes)**

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](http://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](http://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.

```auto
[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}
...
```

---

<div class="post-metadata">

**Author:** ![hairless\_mess](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hairless_mess/32/141984_2.png) [@hairless\_mess](https://discuss.elastic.co/u/hairless_mess)\
**Post date:** [March 26, 2025, 10:53am UTC](https://discuss.elastic.co/t/need-help-setting-up-a-second-node/375785/26 "2025-03-26T10:53:13Z")

</div>

I finally found the problem!

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:

```auto

# 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:

```auto

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

Thanks everyone for helping me out!!

[Previous page](https://discuss.elastic.co/t/need-help-setting-up-a-second-node/375785.md?page=1)
