Why doesn't node.name default to hostname

Trying to add a new node to a cluster only it doesn't seem to default node.name to hostname but rather a random string. Shouldn't it default to hostname?

[2019-07-12T10:55:05,152][INFO ][o.e.n.Node               ] [_u9qFWr] started
[root@es-i1 elasticsearch]# hostname
es-i1

It depends which version you are using. Defaulting node.name to the hostname was added in 7.0

Prior to 7.0 it uses a prefix of the persistent node ID by default.

Okay thanks, I'm on 6.8.1, that figures then, it's just a nicer feature in 7 :slight_smile: as it's a hazzle not to be able to share config file for multiple nodes.

You can use environment variables in the config file to achieve the same effect:

node.name:    ${HOSTNAME}
1 Like

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