Deploy a RabbitMQ 3.12 Three‑Node Cluster on Rocky Linux 9.7 (ARM)
This guide walks through the complete process of setting up a three‑node RabbitMQ 3.12.14 cluster on Rocky Linux 9.7 ARM, covering host configuration, firewall rules, SELinux, time sync, Erlang and RabbitMQ installation, directory layout, cookie synchronization, service start‑up, cluster joining, verification, production hardening, common admin commands and troubleshooting.
Prerequisites and node planning
Three Rocky Linux 9.7 aarch64 hosts (192.168.1.200‑202) are assigned hostnames rabbitmq01, rabbitmq02, rabbitmq03. All nodes must share the same Erlang version (26.2.5) and RabbitMQ version (3.12.14).
1. Uniform host preparation (run on all nodes)
Set hostname with hostnamectl set-hostname rabbitmqXX and add entries to /etc/hosts for the three hosts.
Open required ports permanently:
firewall-cmd --add-port={4369,5672,15672,25672}/tcp --permanentthen reload.
Disable SELinux ( setenforce 0 and edit /etc/selinux/config).
Enable time sync: systemctl start chronyd && systemctl enable chronyd.
Install basic tools: dnf install -y socat logrotate wget openssl iproute.
Create a dedicated rabbitmq system user with home /app/rabbitmq and build the directory tree /app/rabbitmq/{data,logs,etc,plugins}, assigning ownership to the user.
2. Install runtime (run on all nodes)
cd /opt
wget https://github.com/rabbitmq/erlang-rpm/releases/download/v26.2.5/erlang-26.2.5-1.el9.aarch64.rpm
rpm -ivh erlang-26.2.5-1.el9.aarch64.rpm
erl -version
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.12.14/rabbitmq-server-3.12.14-1.el8.noarch.rpm
rpm -ivh rabbitmq-server-3.12.14-1.el8.noarch.rpm
rabbitmqctl version3. Unified configuration (run on all nodes)
Edit /etc/rabbitmq/rabbitmq-env.conf to point all paths to /app/rabbitmq:
# Node name
NODENAME=rabbit@$(hostname -s)
# Data directory
MNESIA_BASE=/app/rabbitmq/data
# Log directory
LOG_BASE=/app/rabbitmq/logs
# Main config file
CONFIG_FILE=/app/rabbitmq/etc/rabbitmq
# Plugins enable file
ENABLED_PLUGINS_FILE=/app/rabbitmq/etc/enabled_plugins
# Home (cookie location)
HOME=/app/rabbitmqDo not set PLUGINS_DIR – the RPM default must be used.
Edit /app/rabbitmq/etc/rabbitmq.conf with the essential settings:
# AMQP listener
listeners.tcp.default = 0.0.0.0:5672
# Management UI
management.tcp.port = 15672
management.tcp.ip = 0.0.0.0
# Resource limits
vm_memory_high_watermark.relative = 0.4
disk_free_limit.absolute = 1GB
# Cluster behaviour
cluster_partition_handling = autoheal
net_ticktime = 60
# Logging
log.file.level = info
log.console = falseSet ownership of the config directories: chown -R rabbitmq:rabbitmq /etc/rabbitmq /app/rabbitmq.
4. Synchronize Erlang cookie (cluster core)
On rabbitmq01 generate a 32‑byte cookie and secure it:
echo -n "$(openssl rand -hex 16)" > /app/rabbitmq/.erlang.cookie
chmod 400 /app/rabbitmq/.erlang.cookie
chown rabbitmq:rabbitmq /app/rabbitmq/.erlang.cookie
ln -sf /app/rabbitmq/.erlang.cookie /root/.erlang.cookieCopy the cookie to the other nodes and fix permissions:
scp /app/rabbitmq/.erlang.cookie [email protected]:/app/rabbitmq/
scp /app/rabbitmq/.erlang.cookie [email protected]:/app/rabbitmq/
chmod 400 /app/rabbitmq/.erlang.cookie
chown rabbitmq:rabbitmq /app/rabbitmq/.erlang.cookie
ln -sf /app/rabbitmq/.erlang.cookie /root/.erlang.cookie5. Single‑node verification
On rabbitmq01 start the service:
systemctl daemon-reload
systemctl enable rabbitmq-server
systemctl start rabbitmq-serverCheck status with systemctl status rabbitmq-server and rabbitmqctl status. The service should be active (running) and report version information.
Enable the management plugin:
rabbitmq-plugins enable rabbitmq_management
rabbitmq-plugins list -e6. Build the three‑node cluster
On rabbitmq02 and rabbitmq03 run:
rabbitmqctl stop_app
rabbitmqctl join_cluster rabbit@rabbitmq01
rabbitmqctl start_appVerify with rabbitmqctl cluster_status; the running_nodes list must contain rabbit@rabbitmq01, rabbit@rabbitmq02, and rabbit@rabbitmq03.
7. Production hardening
Create an admin user:
rabbitmqctl add_user admin Admin@123456 && rabbitmqctl set_user_tags admin administrator && rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"Remove the default insecure guest account: rabbitmqctl delete_user guest 8. Common operational commands
Cluster status: rabbitmqctl cluster_status Node status: rabbitmqctl status List queues: rabbitmqctl list_queues name messages consumers type List exchanges: rabbitmqctl list_exchanges name type Purge a queue: rabbitmqctl purge_queue <em>queue_name</em> User management: rabbitmqctl list_users, rabbitmqctl add_vhost /vhost_name,
rabbitmqctl set_permissions -p /vhost_name user ".*" ".*" ".*"Node removal:
rabbitmqctl stop_app && rabbitmqctl reset && rabbitmqctl start_appthen rabbitmqctl forget_cluster_node rabbit@rabbitmq03 9. Troubleshooting highlights
If startup fails with cd: /home/rabbitmq: No such file or directory, ensure the rabbitmq user’s home directory is set to /app/rabbitmq (use -d /app/rabbitmq on creation or usermod -d /app/rabbitmq rabbitmq).
Empty logs and an erl_crash.dump often mean PLUGINS_DIR was set to an empty path; delete that line from rabbitmq-env.conf to use the default.
CLI errors like Invalid challenge reply indicate a cookie mismatch; create a symlink ln -sf /app/rabbitmq/.erlang.cookie /root/.erlang.cookie on the client host.
Cluster join failures usually stem from hostname resolution, firewall blocks, or cookie differences; verify /etc/hosts, open ports 4369/25672, and confirm identical cookies across nodes.
Finally, access the management UI at http://192.168.1.200:15672 with the admin credentials and confirm all three nodes appear online under the “Nodes” tab.
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.
Linux Cloud-Native Ops Stack
Focused on practical internet operations, sharing server monitoring, troubleshooting, automated deployment, and cloud-native tech insights. From Linux basics to advanced K8s, from ops tools to architecture optimization, helping engineers avoid pitfalls, grow quickly, and become your tech companion.
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.
