Setting Up an Elasticsearch Cluster: Common Issues and How to Fix Them

Struggling to add a node to your Elasticsearch cluster? Learn how Hyperflex helps teams troubleshoot cluster formation, TLS configs, and more for reliable setup.

Elasticsearch is a powerful distributed search and analytics engine, but setting up a multi-node cluster can be tricky—especially when dealing with configuration errors, node discovery issues, and security settings.

At Hyperflex, we specialize in helping businesses deploy and optimize Elasticsearch for high performance, security, and scalability. In this post, we’ll walk through some common issues faced when adding a node to an Elasticsearch cluster, troubleshooting steps, and best practices to ensure a seamless setup.

1. Understanding Elasticsearch Cluster Formation 

An Elasticsearch cluster consists of multiple nodes that work together to handle search and indexing requests efficiently.

  • Master Node: Oversees cluster management and node coordination.
  • Data Nodes: Store and process data.
  • Ingest Nodes: Pre-process incoming data before indexing.

For a successful cluster setup, nodes must properly discover each other, and configuration settings must be correctly defined.

2. Common Issue: New Node Cannot Join the Cluster

A typical problem occurs when a new node fails to join the existing cluster, leading to errors like:

[WARN ][o.e.c.c.ClusterFormationFailureHelper] [node-2] master not discovered yet

This means Node-2 is unable to find and connect to the master node.

3. Troubleshooting Steps

Step 1: Verify Cluster Name

Each node must have the same cluster name. If not, it will form a separate cluster.

Check your cluster name in elasticsearch.yml:

cluster.name: elk-logs   # Must match across all nodes

Step 2: Define Discovery Hosts Correctly

By default, Elasticsearch assumes localhost (127.0.0.1), which prevents nodes from discovering each other in a distributed setup.

On your master node (node-1), ensure it has:

On node-2, define the master node’s IP instead of 127.0.0.1

🚨 Avoid using 127.0.0.1 in discovery.seed_hosts—each node must use its actual IP.

Step 3: Ensure Correct Node Roles

  • If a node has no role defined, it assumes all roles, which can cause conflicts.
  • If node.roles: [data] is set, it means the node cannot become a master.

✅ Ensure that only master nodes have the master role, while data nodes only handle storage and querying.

Step 4: Fix Security & TLS Issues

Elasticsearch requires secure communication between nodes when security is enabled.
If misconfigured, nodes may not authenticate each other, preventing cluster formation.

✅ Ensure xpack.security.transport.ssl settings are identical on all nodes:

💡 Tip: If using self-signed certificates, ensure that all nodes trust the same CA certificate.
Use elasticsearch-certutil to generate and manage certificates.

Step 5: Check Firewall & Network Connectivity

Cluster issues can arise due to firewall settings blocking port 9300.

Allow Elasticsearch communication:

sudo ufw allow 9200/tcp 
sudo ufw allow 9300/tcp  


Verify the node is listening on the correct port:

netstat -tulnp | grep 9300 

Step 6: Restart & Reset the Node State

If a node started before proper configuration, it might be stuck in an incorrect state.

To reset the node and try again:

systemctl stop elasticsearchrm
-rf /var/lib/elasticsearch/nodes
systemctl start elasticsearch

This clears any cached cluster state, forcing the node to rejoin fresh.

🚨 Only reset a single node at a time. Do not do this on all nodes unless reinitializing the entire cluster.

4. Best Practices for Setting Up Elasticsearch Clusters

  1. Always define roles explicitly (node.roles: [master] or node.roles: [data]).
  2. Use correct discovery.seed_hosts settings with actual IPs instead of 127.0.0.1.
  3. Do not include cluster.initial_master_nodes after cluster formation—it should only be used during initial setup.
  4. Ensure TLS settings match across all nodes to prevent security-related connection issues.

Regularly monitor cluster health using:

curl -X GET "http://localhost:9200/_cluster/health?pretty"

       5.The status should be GREEN (healthy), not YELLOW or RED.

5. Get Expert Help with Hyperflex

At Hyperflex, we help businesses deploy, scale, and manage Elasticsearch without headaches.

🚀 Our Elasticsearch services include:

Cluster setup & optimization for high performance
Secure deployments aligned with industry standards
Fully managed Elasticsearch services so your team can focus on business needs

💡 Want a smooth Elasticsearch deployment?
📩 Contact us at marketing@hyperflex.co for expert help or a custom pilot setup.

Final Thoughts

Elasticsearch is a powerful tool, but setting up clusters correctly is crucial to avoiding downtime, data loss, or performance issues. By following best practices and troubleshooting key issues, you can ensure a stable and high-performing Elasticsearch cluster.