Build a RocketMQ Cluster
A RocketMQ cluster normally uses multiple independent NameServers and one or more broker groups. Each broker group has a stable brokerName; broker ID 0 is the primary and nonzero IDs are replicas in older master/slave terminology.
Configure each broker with a unique listening port, storage path, role, flush mode, and the complete NameServer address list. Ensure every node resolves advertised hostnames consistently and that firewalls permit the required broker, HA, and management ports.
Start NameServers first, then brokers. Verify registration with the administrative tools and create a test topic. Send messages, consume them, and inspect queue distribution.
A cluster is not validated until failure behavior is tested. Stop a NameServer and confirm routing still works. Stop a broker and observe producer retries, replica availability, consumer lag, and recovery. Replication mode affects durability and write latency, while automatic failover capabilities vary by RocketMQ architecture and release.
Separate storage failure domains, monitor commit-log disk usage, synchronize clocks, protect administrative endpoints, and rehearse replacement and restore procedures.