# Does node.name need to match ip or hostname?

**URL:** <https://discuss.elastic.co/t/does-node-name-need-to-match-ip-or-hostname/183042>\
**Category:** Elasticsearch\
**Created:** [May 28, 2019, 9:23am UTC](https://discuss.elastic.co/t/does-node-name-need-to-match-ip-or-hostname/183042 "2019-05-28T09:23:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [May 28, 2019, 9:23am UTC](https://discuss.elastic.co/t/does-node-name-need-to-match-ip-or-hostname/183042/1 "2019-05-28T09:23:13Z")

</div>

Hi,

I am setting up my first multi node cluster.

I only made it running, when the node.name equals to the hostname. It did not work when I said:

```
cluster.name: multinode
node.name: 0

```

`hostname` is `multinode-es-0`

I had 3 servers using this type of naming convention (0 to 2). During cluster bootstrap the nodes have not been able to discover themself when I set  
`discovery.seed_hosts` and `cluster.initial_master_nodes` to following value:

`["multinode-es-0", "multinode-es-1", "multinode-es-2"]`

I expected that elasticsearch to discover any nodes on the given hostnames which are part of the same cluster.name.  
I only made it running when setting node.name to hostname.

Was my assumption incorrect or did I just do a mistake during configuration?

Thanks, Andreas

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [May 28, 2019, 10:15am UTC](https://discuss.elastic.co/t/does-node-name-need-to-match-ip-or-hostname/183042/2 "2019-05-28T10:15:58Z")

</div>

> [@asp](#):
>
> Was my assumption incorrect or did I just do a mistake during configuration?

I wouldn't recommend using a bare number like `0` for the node name because it will be hard to identify this as a node name when looking at responses from Elasticsearch like `GET _cat/nodes`. It will work, but it will be confusing.

`discovery.seed_hosts` needs to be set to hostnames or IP addresses since this is about _discovery_, i.e. allowing the nodes to connect to each other.

`cluster.initial_master_nodes` should be set to node names, but once your cluster has formed you can remove it.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 25, 2019, 10:16am UTC](https://discuss.elastic.co/t/does-node-name-need-to-match-ip-or-hostname/183042/3 "2019-06-25T10:16:06Z")

</div>

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