How to Install, Configure, and Manage RabbitMQ on CentOS 7
This guide walks you through setting up RabbitMQ on a CentOS 7 system—including required Erlang installation, RPM package deployment, service enablement, management plugin activation, user and permission handling, MQTT plugin enablement, and an overview of the web UI metrics for monitoring queues, exchanges, connections, and more.
Practice Environment
CentOS-7-x86_64-DVD-2009.iso
rabbitmq-server-3.9.16-1.el7.noarch.rpm (last RabbitMQ version supporting CentOS 7)
https://github.com/rabbitmq/rabbitmq-server/releases/tag/v3.9.16
https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.9.16/rabbitmq-server-3.9.16-1.el7.noarch.rpm
erlang-23.3.4.11-1.el7.x86_64.rpm (last Erlang version supporting CentOS 7)
https://github.com/rabbitmq/erlang-rpm/releases
https://github.com/rabbitmq/erlang-rpm/releases/download/v23.3.4.11/erlang-23.3.4.11-1.el7.x86_64.rpm
Practice Operations
Download RabbitMQ and Erlang Packages
RabbitMQ is built with Erlang, so an Erlang runtime matching the RabbitMQ version is required. Compatibility information can be found at https://www.rabbitmq.com/docs/which-erlang.
Install Packages
# rpm -ivh erlang-23.3.4.11-1.el7.x86_64.rpm
# rpm -ivh rabbitmq-server-3.9.16-1.el7.noarch.rpmAdditional dependencies such as socat and logrotate are listed in the official docs, but they were not installed in this practice.
Run RabbitMQ
After installation the server does not start as a daemon by default. Enable it to start on boot as a daemon: # systemctl enable rabbitmq-server Start/Stop Server
# systemctl start rabbitmq-server
# systemctl status rabbitmq-server
# systemctl stop rabbitmq-serverReference: https://www.rabbitmq.com/docs/install-rpm#running-rpm
Enable Management Plugin
# rabbitmq-plugins enable rabbitmq_managementAfter enabling, the management UI is available at http://<em>node-hostname</em>:15672/. Example screenshot:
Configuration File Management
Locate Configuration Files
# rabbitmq-diagnostics status
... Config files ...
Log file(s):
* /var/log/rabbitmq/[email protected]
* /var/log/rabbitmq/rabbit@localhost_upgrade.logTypical config files are /etc/rabbitmq/advanced.config and /etc/rabbitmq/rabbitmq.conf.
Reference: https://www.rabbitmq.com/docs/configure#configuration-files
User Management
Default User Access
The broker creates a default user guest / guest that can only connect from localhost. To allow remote access, add loopback_users = none to rabbitmq.conf and restart the service.
# vi /etc/rabbitmq/rabbitmq.conf
loopback_users = none
# systemctl restart rabbitmq-serverReference: https://www.rabbitmq.com/docs/install-rpm#default-user-access
Add User
# rabbitmqctl add_user "testacc"
Adding user "testacc" ...
Password: test1234
Done.List Users
# rabbitmqctl list_users
Listing users ...
user tags
testacc []
guest [administrator]
# rabbitmqctl list_users --formatter=json
[{"user":"testacc","tags":[]},{"user":"guest","tags":["administrator"]}]Delete User
# rabbitmqctl delete_user 'username'Set Permissions
Grant permissions on a virtual host:
# rabbitmqctl set_permissions -p "custom-vhost" "username" ".*" ".*" ".*"The three .* patterns correspond to configure, write, and read permissions respectively.
Clear Permissions
# rabbitmqctl clear_permissions -p 'custom-vhost' 'username'Set User Tags
# rabbitmqctl set_user_tags testacc administratorWithout the administrator tag the user cannot access the management UI (error: "Not management user").
References: https://www.rabbitmq.com/docs/man/rabbitmqctl.8#set_user_tags, https://www.rabbitmq.com/docs/access-control#user-management
Login to Management UI
Enable MQTT‑Related Plugins
# rabbitmq-plugins enable rabbitmq_mqtt
# rabbitmq-plugins enable rabbitmq_web_mqtt
# rabbitmq-plugins enable rabbitmq_web_mqtt_examplesAfter enabling, the web MQTT example UI is reachable at http://<em>host-ip</em>:15670/.
Overview (Web UI Metrics)
Totals
Ready: Number of messages ready for delivery. High values may indicate insufficient consumer capacity. Unacked: Messages awaiting consumer acknowledgments. Large numbers suggest consumers are not acking or manual ack is mis‑used. Total: Sum of Ready and Unacked.
Message Rates
Publish: Rate of messages entering the broker. Publish confirm: Rate at which the broker confirms publishes (requires channel confirm mode). Deliver (manual ack) / Deliver (auto ack): Delivery rates for consumers using manual or automatic acknowledgments. Consumer ack: Rate of consumer acknowledgments. Redelivered: Rate of messages marked as redelivered. Get (manual ack) / Get (auto ack) / Get (empty): Rates related to basic.get requests. Return: Rate of mandatory‑flagged undeliverable messages returned to publishers. Disk read / Disk write: Queue disk I/O rates.
Global Counts
Connections: Number of client TCP connections. Channels: Total channels. Exchanges: Total exchanges. Queues: Total queues. Consumers: Total consumers.
Nodes
Name: Node name. File descriptors: OS‑reported file descriptor count and limit. Socket descriptors: RabbitMQ‑managed network socket count and limit. Erlang processes: Number of Erlang processes. Memory: Memory used by the node. Disk space: Disk space used. Uptime: How long the node has been running.
Churn Statistics
Connection Operations
Created: Rate of new connections. Closed: Rate of closed connections.
Channel Operations
Created: Rate of new channels. Closed: Rate of closed channels.
Queue Operations
Declared: Rate of queue declarations. Created: Rate of actual queue creations. Deleted: Rate of queue deletions.
Ports and Contexts
Typical ports:
5672 – AMQP client connections
15672 – RabbitMQ web management console
25672 – Cluster communication
Export / Import Definitions
The exported definitions include users, virtual hosts, permissions, parameters, exchanges, queues, policies, and bindings, but not queue contents. Exclusive queues are omitted.
Import merges definitions with the current configuration; errors do not roll back changes.
Admin
The Admin tab allows management of users, virtual hosts, tags, policies, limits, and clustering.
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.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
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.
