Rocky Linux 9 Distributed Elasticsearch Cluster Setup

Infrastructure Layout

HostnameNetwork AddressRole
es-primary172.16.10.11Initial Master
es-secondary172.16.10.12Worker Node
es-tertiary172.16.10.13Worker Node

Package Repository Initialization

tee /etc/yum.repos.d/es_stack.repo <<EOF
[es-8x-stream]
name=ES 8.x stable repository
baseurl=https://artifacts.elastic.co/packages/8.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
EOF

Software Installation (All Targets)

Adjust cryptographic policies to allow SHA1 signatures for package validation, then proceed with the installation:

update-crypto-policies --set DEFAULT:SHA1
dnf install -y elasticsearch

Primary Node Initialization and Token Generation

Adjust the main configuration file on the initial server:

sed -i 's/^#cluster.name:.*/cluster.name: data-cluster/' /etc/elasticsearch/elasticsearch.yml
sed -i 's/^#network.host:.*/network.host: 0.0.0.0/' /etc/elasticsearch/elasticsearch.yml

Enable and launch the daemon, then produce an enrollment token for secondary machines:

systemctl enable --now elasticsearch
/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s node --url "https://172.16.10.11:9200"

Save the resulting base64 string for subsequent steps.

Validating the Primary Instance

Query the local endpoint using the auto-generated credentials provided during the initial startup:

curl -u elastic --cacert /etc/elasticsearch/certs/http_ca.crt https://127.0.0.1:9200

Expected response structure:

{
  "name" : "es-primary",
  "cluster_name" : "data-cluster",
  "cluster_uuid" : "XyZ123abC-def456",
  "version" : {
    "number" : "8.7.0",
    "build_flavor" : "default"
  },
  "tagline" : "You Know, for Search"
}

Integrating Secondary Nodes

On each remaining host, invoke the reconfiguration utility with the previously generated token:

/usr/share/elasticsearch/bin/elasticsearch-reconfigure-node --enrollment-token <PASTE_TOKEN_HERE>
# Accept the reconfiguration prompt by typing 'y'

Update the configuration parameters to match the primary instance, then activate the service:

sed -i 's/^#cluster.name:.*/cluster.name: data-cluster/' /etc/elasticsearch/elasticsearch.yml
sed -i 's/^#network.host:.*/network.host: 0.0.0.0/' /etc/elasticsearch/elasticsearch.yml
systemctl enable --now elasticsearch

Cluster Integrity Verification

Confirm the topology and health of the distributed system:

curl -u elastic --cacert /etc/elasticsearch/certs/http_ca.crt https://172.16.10.11:9200/_cat/nodes?v
curl -u elastic --cacert /etc/elasticsearch/certs/http_ca.crt https://172.16.10.11:9200/_cluster/health?pretty

The health query should return a green status with three recognized members.

ElasticView Management Interface Setup

Deploy the visual administration tool:

wget https://github.com/1340691923/ElasticView/releases/download/v1.8.7/ElasticViewLinux.zip -P /opt/downloads
mkdir -p /opt/es-view
unzip /opt/downloads/ElasticViewLinux.zip -d /opt/es-view
cd /opt/es-view
chmod +x ElasticViewLinux
nohup ./ElasticViewLinux > ev_runtime.log 2>&1 &

Access the dashboard at http://172.16.10.11:8090 utilizing the default credentials (admin / admin).

Tags: elasticsearch Rocky Linux Cluster Deployment Linux Administration Data Search

Posted on Thu, 24 Sep 2026 16:24:15 +0000 by SchweppesAle