Elasticsearch Multi-Node Cluster on AlmaLinux 9
Architecture
- node-1 (master-eligible + data): 192.168.1.10
- node-2 (master-eligible + data): 192.168.1.11
- node-3 (master-eligible + data): 192.168.1.12
Step 1 – Install Elasticsearch on all nodes
See Install Elasticsearch on AlmaLinux 9.
Step 2 – Configure node-1 (/etc/elasticsearch/elasticsearch.yml)
cluster.name: production-cluster
node.name: node-1
node.roles: [ master, data, ingest ]
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: 192.168.1.10
http.port: 9200
transport.port: 9300
discovery.seed_hosts:
- 192.168.1.10
- 192.168.1.11
- 192.168.1.12
cluster.initial_master_nodes:
- node-1
- node-2
- node-3
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: /etc/elasticsearch/certs/transport.p12
xpack.security.transport.ssl.truststore.path: /etc/elasticsearch/certs/transport.p12
Step 3 – Generate certificates (on node-1)
/usr/share/elasticsearch/bin/elasticsearch-certutil ca
/usr/share/elasticsearch/bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12
Distribute transport.p12 to all nodes.
Step 4 – Start all nodes
systemctl start elasticsearch
Step 5 – Check cluster health
curl -u elastic:YourPassword --cacert /etc/elasticsearch/certs/http_ca.crt \
'https://localhost:9200/_cluster/health?pretty'
Expected: "status": "green", "number_of_nodes": 3.