Meaningful node names make Elasticsearch clusters easier to operate by turning shard allocation, logs, and monitoring dashboards into readable, human-friendly outputs instead of a blur of hostnames and IPs.
Elasticsearch reads the node.name setting from /etc/elasticsearch/elasticsearch.yml during startup and advertises it to the cluster. When node.name is unset, the node name defaults to the system hostname and is shown in APIs such as /_cat/nodes and in log messages.
Node names must be unique within a cluster, and renaming requires a service restart to take effect. Changing node.name updates the label used for display and monitoring, but does not change the persistent node ID stored under the node’s data path, so a rename can still confuse inventory tooling if naming conventions are inconsistent.
Steps to set Elasticsearch node names:
- Open the Elasticsearch configuration file.
$ sudo nano /etc/elasticsearch/elasticsearch.yml
- Set a unique node.name value in the configuration.
node.name: node-01
Keep the name unique within the cluster, and prefer stable names that match monitoring labels (for example tier + sequence).
- Restart the Elasticsearch service to apply the new name.
$ sudo systemctl restart elasticsearch
Restarting a single-node cluster stops search and indexing until Elasticsearch is running again, and restarting multiple nodes at once can make shards temporarily unavailable.
- Verify the node name in the cluster node list.
$ curl --silent --show-error --cacert /etc/elasticsearch/certs/http_ca.crt --user elastic "https://localhost:9200/_cat/nodes?v&h=name,ip,node.role,master" Enter host password for user 'elastic': name ip node.role master node-01 192.0.2.40 cdfhilmrstw *
Clusters without TLS or authentication can use http://localhost:9200 and omit --cacert and --user.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
