Meaningful node names make Elasticsearch clusters easier to operate because shard allocation views, recovery output, logs, and alerts identify the affected machine immediately instead of forcing operators to decode generic hostnames or transient container IDs.

For self-managed package installs, Elasticsearch reads node.name from /etc/elasticsearch/elasticsearch.yml at startup. The setting is static, so the new value is only applied after the node restarts, and the configured name is what APIs such as /_cat/nodes expose in the name column.

Node names must stay unique within the cluster and should follow a consistent naming convention that matches operations and monitoring labels. Renaming only requires restarting the affected node, not a full-cluster restart, but current Elastic documentation also requires bootstrap lists such as cluster.initial_master_nodes to match node.name exactly during first-cluster formation. Current package installs commonly expose the HTTP API over HTTPS with authentication and the standard HTTPS trust configuration.

Steps to set Elasticsearch node names:

  1. Record the current node list before changing the name.
    $ curl -sS --fail --user elastic "https://localhost:9200/_cat/nodes?v&s=name&h=name,ip,node.role,master"
    Enter host password for user 'elastic':
    name         ip         node.role   master
    es-data-01   192.0.2.40 dim         *
    es-ingest-01 192.0.2.41 i           -

    Clusters with security disabled can use plain HTTP without authentication.

  2. Create a backup copy of /etc/elasticsearch/elasticsearch.yml before editing it.
    $ sudo cp -a /etc/elasticsearch/elasticsearch.yml /etc/elasticsearch/elasticsearch.yml.bak
  3. Edit /etc/elasticsearch/elasticsearch.yml and set a unique node.name value for this node.
    $ sudo nano /etc/elasticsearch/elasticsearch.yml
    node.name: es-hot-01

    Use a name that remains unique within the cluster and reflects the node's role, tier, or location consistently.

    If this node is still listed in cluster.initial_master_nodes during first-cluster bootstrap, the entry must match the new node.name exactly. On an existing cluster, that bootstrap setting should already be removed.

  4. Restart the Elasticsearch service so the static setting is reloaded.
    $ sudo systemctl restart elasticsearch

    Restarting multiple cluster nodes at the same time can interrupt indexing and make shards temporarily unavailable.

  5. Confirm the Elasticsearch service returned to a running state.
    $ systemctl is-active elasticsearch
    active

    If the unit does not return active, inspect the service status and recent logs before retrying the restart.

  6. Verify the cluster now reports the new node name.
    $ curl -sS --fail --user elastic "https://localhost:9200/_cat/nodes?v&s=name&h=name,ip,node.role,master"
    Enter host password for user 'elastic':
    name         ip         node.role   master
    es-hot-01    192.0.2.40 dim         *
    es-ingest-01 192.0.2.41 i           -

    Renaming a node changes its display label, but the persistent node ID stays the same.