Deploying a Two‑Node Elasticsearch Cluster with Security Configuration
This guide explains how to set up a simple two‑node Elasticsearch cluster in a cloud environment, covering prerequisite checks, installation, configuration of master and slave nodes, certificate handling, password setup, and verification of the cluster’s health.
Elasticsearch is a distributed search server built on Lucene that provides a RESTful API and is widely used in cloud computing for real‑time, reliable, and fast search capabilities.
The tutorial walks through extending a single‑node ES deployment to a basic two‑node cluster.
Step 1: Verify JDK installation.
Step 2: Install Elasticsearch on both machines.
Step 3: Start Elasticsearch and check the logs.
Step 4: Configure the nodes. The main configuration parameters include:
master node: cluster.name: hahashen node.name: node1
slave node: cluster.name: hahashen node.name: node2 node.master: true node.data: true path.data: /var/lib/elasticsearch path.logs: /var/log/elasticsearch network.host: 0.0.0.0 http.port: 9200 discovery.seed_hosts: ["192.168.20.41", "192.168.20.42"] cluster.initial_master_nodes: ["192.168.20.41", "192.168.20.42"] xpack.security.enabled: true xpack.monitoring.enabled: true xpack.security.transport.ssl.enabled: true xpack.security.transport.ssl.verification_mode: certificate xpack.security.transport.ssl.keystore.path: /etc/elasticsearch/elastic-certificates.p12 xpack.security.transport.ssl.truststore.path: /etc/elasticsearch/elastic-certificates.p12
Step 5: Copy the generated elastic-certificates.p12 certificate to the slave node and set ownership:
chown elasticsearch:elasticsearch /etc/elasticsearch/elastic-certificates.p12Step 6: Restart the master Elasticsearch instance first, then start the slave instance.
Step 7: Set the built‑in passwords for the cluster (e.g., for the hahashen user):
/usr/share/elasticsearch/bin/elasticsearch-setup-passwords interactiveStep 8: Verify that the cluster is running correctly by checking the status of both master and slave nodes.
The guide concludes with a reminder to follow the DevOps community for further updates.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Practical DevOps Architecture
Hands‑on DevOps operations using Docker, K8s, Jenkins, and Ansible—empowering ops professionals to grow together through sharing, discussion, knowledge consolidation, and continuous improvement.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
