Learn how to – How To Install RabbitMQ on RHEL 8 / CentOS 8.
How can I install RabbitMQ Server on RHEL 8 / CentOS 8 server?. This guide has been written to help you install the latest release of RabbitMQ on RHEL / CentOS 8 server or Workstation. RabbitMQ is an open source message broker software that implements the Advanced Message Queuing Protocol (AMQP).
RabbitMQ works by receiving messages from publishers (applications that publish them) and routes them to consumers (applications that process them).
In our previous guides, we covered:
Follow our steps below to have RabbitMQ Server installed and running on your RHEL/CentOS 8 server.
Step 1: Install EPEL repository
A number of dependencies are available on the EPEL repository, enable it on your system using our guide below.
Step 2: Update System
Once the EPEL repository is added, update your system
sudo yum -y update
Step 3: Add PackageCloud Yum Repository
A Yum repository with RabbitMQ packages is available from PackageCloud.
$ curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh | sudo bash
Detected operating system as rhel/8.
Checking for curl...
Detected curl...
Downloading repository file: https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/config_file.repo?os=rhel&dist=8&source=script
done.
Installing yum-utils...
rabbitmq_rabbitmq-server-source 336 B/s | 819 B 00:02
rabbitmq_rabbitmq-server-source 5.1 kB/s | 3.9 kB 00:00
Importing GPG key 0x4D206F89:
Userid : "https://packagecloud.io/rabbitmq/rabbitmq-server (https://packagecloud.io/docs#gpg_signing) <support@packagecloud.io>"
Fingerprint: 8C69 5B02 19AF DEB0 4A05 8ED8 F4E7 8920 4D20 6F89
From : https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
rabbitmq_rabbitmq-server-source 69 B/s | 296 B 00:04
Last metadata expiration check: 0:00:01 ago on Fri 20 Jan 2023 04:27:54 PM UTC.
Dependencies resolved.
....
Also add Erlang repository:
$ curl -s https://packagecloud.io/install/repositories/rabbitmq/erlang/script.rpm.sh | sudo bash
Detected operating system as rhel/8.
Checking for curl...
Detected curl...
Downloading repository file: https://packagecloud.io/install/repositories/rabbitmq/erlang/config_file.repo?os=rhel&dist=8&source=script
done.
Installing yum-utils...
rabbitmq_erlang-source 243 B/s | 819 B 00:03
rabbitmq_erlang-source 4.7 kB/s | 3.8 kB 00:00
Importing GPG key 0xDF309A0B:
Userid : "https://packagecloud.io/rabbitmq/erlang (https://packagecloud.io/docs#gpg_signing) <support@packagecloud.io>"
Fingerprint: 2EBD E413 D3CE 5D35 BCD1 5B7C 71C6 3471 DF30 9A0B
From : https://packagecloud.io/rabbitmq/erlang/gpgkey
rabbitmq_erlang-source 78 B/s | 296 B 00:03
Package yum-utils-4.0.21-14.1.el8.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete!
Generating yum cache for rabbitmq_erlang...
Importing GPG key 0xDF309A0B:
Userid : "https://packagecloud.io/rabbitmq/erlang (https://packagecloud.io/docs#gpg_signing) <support@packagecloud.io>"
Fingerprint: 2EBD E413 D3CE 5D35 BCD1 5B7C 71C6 3471 DF30 9A0B
From : https://packagecloud.io/rabbitmq/erlang/gpgkey
Generating yum cache for rabbitmq_erlang-source...
The repository is setup! You can now install packages.
Step 4: Install RabbitMQ on RHEL 8 / CentOS 8
Once you have configured RabbitMQ repository, install RabbitMQ Server on RHEL / CentOS 8 by running below commands.
sudo yum makecache -y --disablerepo='*' --enablerepo='rabbitmq_rabbitmq-server'
sudo yum -y install rabbitmq-server
Package details can be queried rpm
-qi
.
$ rpm -qi rabbitmq-server
Name : rabbitmq-server
Version : 3.11.7
Release : 1.el8
Architecture: noarch
Install Date: Fri 20 Jan 2023 04:33:32 PM UTC
Group : Development/Libraries
Size : 22977039
License : MPLv2.0 and MIT and ASL 2.0 and BSD
Signature : RSA/SHA512, Tue 17 Jan 2023 01:12:35 PM UTC, Key ID 6b73a36e6026dfca
Source RPM : rabbitmq-server-3.11.7-1.el8.src.rpm
Build Date : Tue 17 Jan 2023 01:03:17 PM UTC
Build Host : 5f47108b-fbf9-4e40-610e-920d248e40c4
Relocations : (not relocatable)
URL : https://www.rabbitmq.com/
...
Step 5: Start RabbitMQ Service
Now that you have RabbitMQ installed on RHEL 8, start and enable the service to start on system boot.
echo "127.0.0.1 $(hostname -s)" | sudo tee -a /etc/hosts
sudo systemctl enable --now rabbitmq-server.service
Check the status of RabbitMQ with:
$ systemctl status rabbitmq-server.service
● rabbitmq-server.service - RabbitMQ broker
Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2023-01-20 16:34:08 UTC; 19s ago
Main PID: 3729 (beam.smp)
Tasks: 25 (limit: 23036)
Memory: 100.8M
CGroup: /system.slice/rabbitmq-server.service
├─3729 /usr/lib64/erlang/erts-13.1.3/bin/beam.smp -W w -MBas ageffcbf -MHas ageffcbf -MBlmbcs 512 -MHlmbcs 512 -MMmcs 30 -P 1048576 -t 5000000 -stbt db -zdbbl 128000 -sbwt none -sbwtdcpu>
├─3743 erl_child_setup 32768
├─3768 /usr/lib64/erlang/erts-13.1.3/bin/epmd -daemon
├─3789 /usr/lib64/erlang/erts-13.1.3/bin/inet_gethost 4
├─3790 /usr/lib64/erlang/erts-13.1.3/bin/inet_gethost 4
└─3795 /bin/sh -s rabbit_disk_monitor
Jan 20 16:34:03 rhel8.mylab.io rabbitmq-server[3729]: Doc guides: https://rabbitmq.com/documentation.html
Jan 20 16:34:03 rhel8.mylab.io rabbitmq-server[3729]: Support: https://rabbitmq.com/contact.html
Jan 20 16:34:03 rhel8.mylab.io rabbitmq-server[3729]: Tutorials: https://rabbitmq.com/getstarted.html
Jan 20 16:34:03 rhel8.mylab.io rabbitmq-server[3729]: Monitoring: https://rabbitmq.com/monitoring.html
Jan 20 16:34:03 rhel8.mylab.io rabbitmq-server[3729]: Logs: /var/log/rabbitmq/rabbit@rhel8.log
Jan 20 16:34:03 rhel8.mylab.io rabbitmq-server[3729]: /var/log/rabbitmq/rabbit@rhel8_upgrade.log
Jan 20 16:34:03 rhel8.mylab.io rabbitmq-server[3729]: <stdout>
Jan 20 16:34:03 rhel8.mylab.io rabbitmq-server[3729]: Config file(s): (none)
Jan 20 16:34:08 rhel8.mylab.io rabbitmq-server[3729]: Starting broker... completed with 0 plugins.
Jan 20 16:34:08 rhel8.mylab.io systemd[1]: Started RabbitMQ broker.
RabbitMQ internal details are available on:
$ sudo rabbitmqctl status
Status of node rabbit@rhel8 ...
Runtime
OS PID: 3729
OS: Linux
Uptime (seconds): 57
Is under maintenance?: false
RabbitMQ version: 3.11.7
RabbitMQ release series support status: supported
Node name: rabbit@rhel8
Erlang configuration: Erlang/OTP 25 [erts-13.1.3] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [jit:ns]
Crypto library: OpenSSL 1.1.1k FIPS 25 Mar 2021
Erlang processes: 274 used, 1048576 limit
Scheduler run queue: 1
Cluster heartbeat timeout (net_ticktime): 60
Plugins
Enabled plugin file: /etc/rabbitmq/enabled_plugins
Enabled plugins:
....
Step 6: Enable the RabbitMQ Management Dashboard (Optional)
You can optionally enable the RabbitMQ Management Web dashboard for easy management.
$ sudo rabbitmq-plugins enable rabbitmq_management
Enabling plugins on node rabbit@rhel8:
rabbitmq_management
The following plugins have been configured:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch
Applying plugin configuration to rabbit@rhel8…
The following plugins have been enabled:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch
started 3 plugins.
The Web service should be listening on TCP port 15672
# ss -tunelp | grep 15672 tcp LISTEN 0 128 0.0.0.0:15672 0.0.0.0:* users:(("beam.smp",pid=9525,fd=71)) uid:111 ino:39934 sk:9 <->
If you have an active Firewalld service, allow ports 5672
and 15672
sudo firewall-cmd --add-port={5672,15672}/tcp --permanent
sudo firewall-cmd --reload
Access it by opening the URL http://[server IP|Hostname]:15672
By default, the guest user exists and can connect only from localhost
. You can log in with this user locally with the password “guest”
To be able to login on the network, create an admin user like below:
$ sudo rabbitmqctl add_user admin StrongPassword
Adding user "admin" …
$ sudo rabbitmqctl set_user_tags admin administrator
Setting tags for user "admin" to [administrator] …
Login with this admin username and the password assigned. You should see an interface similar to below.
To use rabbitmqadmin
command line tool, copy it to your $PATH.
sudo yum -y install mlocate
sudo updatedb
sudo cp $(locate rabbitmqadmin) /usr/local/bin/rabbitmqadmin
sudo chmod +x /usr/local/bin/rabbitmqadmin
You need to have python
installed and configured to run rabbitmqadmin, see below
RabbitMQ User Management Commands
Delete User:
sudo rabbitmqctl delete_user user
Change User Password:
sudo rabbitmqctl change_password user strongpassword
Create new Virtualhost:
sudo rabbitmqctl add_vhost /my_vhost
List available Virtualhosts:
sudo rabbitmqctl list_vhosts
Delete a virtualhost:
sudo rabbitmqctl delete_vhost /myvhost
Grant user permissions for vhost:
sudo rabbitmqctl set_permissions -p /myvhost user ".*" ".*" ".*"
List vhost permissions:
sudo rabbitmqctl list_permissions -p /myvhost
To list user permissions:
rabbitmqctl list_user_permissions user
Delete user permissions:
rabbitmqctl clear_permissions -p /myvhost user
The next article to read is:
Leave a Reply
You must be logged in to post a comment.