Cluster Operations¶
Adding a node to an existing Elasticsearch cluster¶
- Add the new host to the
elasticsearchinventory group - Run the playbook — the role detects the new node and includes it in
discovery.seed_hosts - The existing cluster auto-accepts the new node because it trusts the same CA
elasticsearch:
hosts:
es1: { ansible_host: 10.0.1.10 }
es2: { ansible_host: 10.0.1.11 }
es3: { ansible_host: 10.0.1.12 }
es4: { ansible_host: 10.0.1.13 } # new node
The CA generates a new certificate for es4, distributes it, and the node joins the cluster. Existing nodes are updated with the new discovery.seed_hosts list.
Note
During a fresh bootstrap, the role fails when the current play contains an even number of master-eligible hosts. If you run a limited play for a node joining an existing cluster, set elasticsearch_cluster_set_up: true so the bootstrap check is skipped. Keep the established cluster's master-eligible count odd; add a new node as data-only (elasticsearch_node_types: ["data", "ingest"]) or add two master-eligible nodes together.
For a limited join play, set the existing-cluster flag explicitly on the new host. Its local initialization marker does not exist yet, so automatic detection cannot identify the cluster state:
Dedicated node roles (hot/warm/cold)¶
For tiered storage architectures:
elasticsearch_node_types: ["master", "data_hot", "ingest"]
elasticsearch_heap: 16
elasticstack_temperature: hot
elasticsearch_node_types: ["data_warm"]
elasticsearch_heap: 8
elasticstack_temperature: warm
elasticsearch_node_types: ["data_cold"]
elasticsearch_heap: 4
elasticstack_temperature: cold
The elasticstack_temperature variable sets node.attr.temp in elasticsearch.yml, which ILM policies use for data tier routing.
Snapshot repository setup¶
Configure filesystem paths for Elasticsearch snapshots:
elasticsearch_fs_repo:
- /mnt/backups/elasticsearch
- /mnt/nfs/snapshots
The paths must be accessible from every ES node (typically shared NFS mounts). The role sets path.repo in elasticsearch.yml. After deployment, create the snapshot repository via Kibana or the API.