Skip to content

EMQX Cluster Nodes Not Connecting

DodaTech Updated 2026-06-26 1 min read

In this tutorial, you'll learn about EMQX Cluster Nodes Not Connecting. We cover key concepts, practical examples, and best practices.

The Problem

EMQX nodes cannot form a cluster across multiple servers.

Quick Fix

Wrong

emqx_ctl cluster join emqx2@192.168.1.2  # Node not reachable
Join fails — node not reachable or cookie mismatch.
# 1. Check node cookie (must match on all nodes)
sudo cat /etc/emqx/emqx.conf | grep cookie
# 2. Set cookie explicitly
# node.cookie = 'mysecrectcookie'

# 3. Ensure ports are open
sudo ufw allow 4370  # EPMD
sudo ufw allow 5370  # Cluster communication

# 4. Join cluster (on one node)
emqx_ctl cluster join emqx@node2.example.com

# 5. Verify
emqx_ctl cluster status
Cluster status: 2 nodes running.

Prevention

All nodes must use the same cookie. Open firewall ports 4370 (EPMD) and 5370 (cluster). Nodes should have synchronized clocks (NTP). Use static cluster or DNS-based discovery for auto-clustering. EMQX Enterprise supports multi-datacenter replication.

DodaTech engineers apply these same patterns across Doda Browser, DodaZIP, and Durga Antivirus Pro for production IoT reliability.

FAQ

### What is the Erlang cookie?

A shared secret for Erlang distributed node communication. All cluster nodes must have the same cookie value.

What discovery methods are supported?

Manual (emqx_ctl cluster join), Static (node list in config), DNS (A record lookups), Kubernetes (Headless service).

Can I have a cluster across datacenters?

EMQX Enterprise supports MQTT bridges for cross-DC. Open Telnet for direct cluster requires low latency (<50ms) between nodes.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro