Keep messaging available when a node fails
A single broker is a single point of failure. High-availability clustering runs several Coreflux MQTT Broker nodes as one system: if one node stops, the others keep serving clients. Clients can connect to any healthy node. Important messages (QoS 1 and 2) are copied across nodes so a crash of a minority of the cluster cannot erase a message the broker already accepted.When to use clustering
Use clustering when you need:- continuous MQTT service if one broker stops or is restarted;
- important publishes (QoS 1/2) to survive if some of the nodes crash after the broker has accepted them; or
- a fixed or elastic set of broker nodes that should act as one cluster.
Clustering is broker configuration, not a LoT System Route. For topic sync with another MQTT broker (including non-Coreflux), use an MQTT Bridge instead.
Configure each node with the same cluster identity and discovery settings, then deploy the same LoT project to every node through your normal workflow.
Quick Start
Add aCluster section to the broker configuration (or matching environment variables — env vars override the file). On every node, create a dedicated MQTT user for inter-node traffic and set DataPlaneUsername to that username so nodes can exchange topic data.
- Seeds (typical production)
- Multicast (same LAN)
- Kubernetes
Use fixed peer addresses when automatic discovery is unavailable (cloud, most Kubernetes networks, multi-subnet LANs):
Concepts operators need
- One leader. Runtime LoT write commands run only on the current leader. Followers reject writes and tell you which node is the leader. Read-only and node-local commands (queries, diagnostics, license/instance key) still run locally.
- LoT is not copied between nodes. Each node loads its own LoT from disk / GitOps. A write applied on the leader changes only that node until you distribute the same project files to the others. Point runtime tooling at the leader, and treat your project repository as the source of truth for all nodes.
- Only matching nodes join. Nodes must share the same cluster identity and join secret so unrelated brokers do not join by accident. (See
ClusterIdandSharedSecretin the configuration reference.) - Session failover needs durability. Enable MQTT state durability so a client that reconnects to another node can get its subscriptions back. Messages queued for offline clients stay on the node that hosted them (see Limitations).
Configuration reference
Core options
The data plane starts only when
DataPlaneEnabled is true and DataPlaneUsername names a user that exists in the broker MQTT user store on that node.
Replication options
Ports
Open these between cluster members in your firewall or network policies.
Delivery guarantees
Summary: once the broker has accepted a QoS 1 or 2 publish, that message is stored on a majority of nodes and can be replayed if ownership moves after a failure. If the cluster is split and this side no longer has a majority, it rejects those publishes instead of accepting messages it cannot keep safe.
Operations
Bootstrap and failover
- A node that sees an existing leader joins as a follower.
- If no leader is visible and peers exist, the cluster elects a leader and adds members as they are discovered.
- When the leader is lost, a new one is elected quickly (typically within a fraction of a second). Survivors stop contacting confirmed-dead peers and bring returning nodes back into the mesh automatically.
- With seeds discovery, a stopped node can remain a configured member (marked unavailable) while majority is computed over the configured list. Prefer kubernetes discovery when instances come and go often.
Observability
Use MQTT Explorer or any MQTT client to subscribe to the
$SYS/Coreflux/Cluster/# topics, or call GET /cluster on each node’s operations HTTP port.
Limitations
Next Steps
MQTT State Durability
Persist retained messages, sessions, and queued QoS across restarts — required for session failover.
Broker Configuration
Ports, TLS, listeners, and other broker settings for each node.

