Nodes' names out of the box are just some random values, like "8akjns787k". For humans it's easier if these names are the same as names of the hosts running ELK (say, "host-001-dev" or something like that). I'm wondering if there's a way to automate setting node name to be the same as host name. If there are only few nodes in the system, it's easy to simply change it in the config (/etc/elasticsearch/elasticsearch.yml - see below). However, when the whole ecosystem grows bigger, it would be better (and easier) to automate it.
In my case the ELK stack runs on Debian Jessie.
# ------------------------------------ Node ------------------------------------
# Use a descriptive name for the node:
#
node.name: host001
So is there any way to do so?
Many thanks in advance for your suggestions.
My question seems to be the same as Setting Node ID, but the OP did not get any replies, so I decided to create a new thread.
@eperry thanks for the info. I forgot to mention that I'm running ELK v5.0, but it works just fine anyway.
Just in case someone has a similar problem in the future, here's the config:
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
# elasticsearch
node.name: ${HOSTNAME}
#elasticsearch
The way that I solved it is to set the node name on the command line using a -D. I run multiple nodes per host and so I add a suffix to indicate the node within the host. I also force the ports so that node 0 has ports 9300/9200 etc. I would advise against using the hostname as the can be quite long if you are collecting stats, I use the last few digits once the names get long.
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.