How to install RabbitMQ in Fedora 35

In this guide we will explore how to install the latest release of RabbitMQ in Fedora 35 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).

Prerequisites

To follow along, ensure you have the following

  • An updated Fedora 35 server
  • Access to the internet
  • Root access or user with Sudo access

Table of Content

  1. Updating the system
  2. Adding PackageCloud Yum Repository
  3. Installing Erlang
  4. Installing RabbitMQ
  5. Starting and enabling rabbitmq-server service
  6. Optional: Enabling RabbitMQ Dashboard
  7. Basic RabbitMQ User Management Commands

1. Updating the system

Before proceeding, ensure that the server packages are up to date. Use this command to achieve that:

sudo dnf -y update

2. Adding PackageCloud Yum Repository

The RabbitMQ package is distributed via Yum repositories on PackageCloud. Install the PackageCloud Yum repository using this command:

curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh | sudo bash

This is the output on my server:

$ curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh | sudo bash
Detected operating system as fedora/34.
Checking for curl...
Detected curl...
Downloading repository file: https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/config_file.repo?os=fedora&dist=34&source=script
done.
Installing pygpgme to verify GPG signatures...
rabbitmq_erlang                                                                                                                                                       3.2 kB/s | 951  B     00:00
rabbitmq_erlang-source                                                                                                                                                4.5 kB/s | 951  B     00:00
rabbitmq_rabbitmq-server-source                                                                                                                                       1.4 kB/s | 819  B     00:00
rabbitmq_rabbitmq-server-source                                                                                                                                        23 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                                                                                                                                       393  B/s | 296  B     00:00
No match for argument: pygpgme
Error: Unable to find a match: pygpgme

WARNING:
The pygpgme package could not be installed. This means GPG verification is not possible for any RPM installed on your system.
To fix this, add a repository with pygpgme. Usualy, the EPEL repository for your system will have this.
More information: https://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F

Installing yum-utils...
rabbitmq_rabbitmq-server-source                                                                                                                                       4.6 kB/s | 951  B     00:00
Package dnf-utils-4.0.24-1.fc34.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete!

WARNING:
The yum-utils package could not be installed. This means you may not be able to install source RPMs or use other yum features.

Generating yum cache for rabbitmq_rabbitmq-server...
Generating yum cache for rabbitmq_rabbitmq-server-source...

The repository is setup! You can now install packages.

3. Installing Erlang

RabbitMQ requires Erlang/OTP to run. The rabbitmq/erlang-rpm project provides a zero dependency 64-bit Erlang RPM package that provides just enough to run RabbitMQ. Get the latest from the releases here https://github.com/rabbitmq/erlang-rpm/releases.

curl -LO -C - https://github.com/rabbitmq/erlang-rpm/releases/download/v24.1.4/erlang-24.1.4-1.el8.x86_64.rpm

Then install the downloaded file

sudo dnf install ./erlang-24.1.4-1.el8.x86_64.rpm

This is the output on my server

$ sudo dnf install ./erlang-24.1.4-1.el8.x86_64.rpm
rabbitmq_rabbitmq-server                                             1.3 kB/s | 833  B     00:00
rabbitmq_rabbitmq-server-source                                      1.6 kB/s | 819  B     00:00
Dependencies resolved.
=====================================================================================================
 Package             Architecture        Version                     Repository                 Size
=====================================================================================================
Installing:
 erlang              x86_64              24.1.4-1.el8                @commandline               20 M

Transaction Summary
=====================================================================================================
Install  1 Package

Total size: 20 M
Installed size: 36 M
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                             1/1
  Installing       : erlang-24.1.4-1.el8.x86_64                                                  1/1
  Running scriptlet: erlang-24.1.4-1.el8.x86_64                                                  1/1
  Verifying        : erlang-24.1.4-1.el8.x86_64                                                  1/1

Installed:
  erlang-24.1.4-1.el8.x86_64

Complete!

4. Installing Rabbitmq

Once you have configured RabbitMQ repository, install RabbitMQ Server using the commands below.

sudo dnf install -y rabbitmq-server

Package details can be queried using rpm command with the option&nbsp;-qi.

$ rpm -qi rabbitmq-server
Name        : rabbitmq-server
Version     : 3.8.23
Release     : 1.fc34
Architecture: x86_64
Install Date: Fri 12 Nov 2021 07:14:47 PM UTC
Group       : Unspecified
Size        : 16503697
License     : MPLv1.1
Signature   : RSA/SHA256, Wed 20 Oct 2021 03:42:27 PM UTC, Key ID 1161ae6945719a39
Source RPM  : rabbitmq-server-3.8.23-1.fc34.src.rpm
Build Date  : Wed 20 Oct 2021 03:16:35 PM UTC
Build Host  : buildvm-x86-11.iad2.fedoraproject.org
Packager    : Fedora Project
Vendor      : Fedora Project
URL         : https://www.rabbitmq.com/
Bug URL     : https://bugz.fedoraproject.org/rabbitmq-server
Summary     : The RabbitMQ server
Description :
RabbitMQ is an implementation of AMQP, the emerging standard for high
performance enterprise messaging. The RabbitMQ server is a robust and
scalable implementation of an AMQP broker.

5. Starting and enabling rabbitmq-server service

Start the service

sudo systemctl start rabbitmq-server

Then check the status to confirm its running

$ sudo systemctl status rabbitmq-server
● rabbitmq-server.service - RabbitMQ broker
     Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; disabled; vendor preset: disabled)
     Active: active (running) since Fri 2021-11-12 19:15:12 UTC; 2s ago
   Main PID: 67336 (beam.smp)
     Status: "Initialized"
      Tasks: 23 (limit: 4603)
     Memory: 93.1M
        CPU: 7.581s
     CGroup: /system.slice/rabbitmq-server.service
             ├─67336 /usr/lib64/erlang/erts-11.2.2.7/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 -sbw>
             ├─67345 erl_child_setup 1024
             ├─67387 inet_gethost 4
             └─67388 inet_gethost 4

Nov 12 19:15:08 cloudsrv.citizix.com rabbitmq-server[67336]:   TLS Library: OpenSSL - OpenSSL 1.1.1l  FIPS 24 Aug 2021
Nov 12 19:15:08 cloudsrv.citizix.com rabbitmq-server[67336]:   Doc guides:  https://rabbitmq.com/documentation.html
Nov 12 19:15:08 cloudsrv.citizix.com rabbitmq-server[67336]:   Support:     https://rabbitmq.com/contact.html
Nov 12 19:15:08 cloudsrv.citizix.com rabbitmq-server[67336]:   Tutorials:   https://rabbitmq.com/getstarted.html
Nov 12 19:15:08 cloudsrv.citizix.com rabbitmq-server[67336]:   Monitoring:  https://rabbitmq.com/monitoring.html
Nov 12 19:15:08 cloudsrv.citizix.com rabbitmq-server[67336]:   Logs: /var/log/rabbitmq/rabbit@cloudsrv.log
Nov 12 19:15:08 cloudsrv.citizix.com rabbitmq-server[67336]:         /var/log/rabbitmq/rabbit@cloudsrv_upgrade.log
Nov 12 19:15:08 cloudsrv.citizix.com rabbitmq-server[67336]:   Config file(s): /etc/rabbitmq/rabbitmq.conf
Nov 12 19:15:12 cloudsrv.citizix.com rabbitmq-server[67336]:   Starting broker... completed with 0 plugins.
Nov 12 19:15:12 cloudsrv.citizix.com systemd[1]: Started RabbitMQ broker.

Now you can enable it on boot

sudo systemctl enable rabbitmq-server

You can get status of rabbitmq internals:

$ sudo rabbitmqctl status

6. Optional: Enabling RabbitMQ Dashboard

Use the rabbitmq-plugins enable command to enable the management dashboard:

$ sudo rabbitmq-plugins enable rabbitmq_management
Enabling plugins on node rabbit@cloudsrv:
rabbitmq_management
The following plugins have been configured:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_web_dispatch
Applying plugin configuration to rabbit@cloudsrv...
The following plugins have been enabled:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_web_dispatch

started 3 plugins.

The web service is up listening on port 15672

$ ss -tunlp | grep 15672
tcp   LISTEN 0      128          0.0.0.0:15672      0.0.0.0:*

If you have an active Firewalld service, allow ports 5672 and 15672

$ ss -tunlp | grep 15672
tcp   LISTEN 0      1024         0.0.0.0:15672      0.0.0.0:*

Access it by opening the URL <a href="https://computingforgeeks.com/" target="_blank" rel="noreferrer noopener">http://[server</a>&nbsp;IP]:15672 like http://127.0.0.1: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 Secr3t
Adding user "admin" ...
Done. Don't forget to grant the user permissions to some virtual hosts! See 'rabbitmqctl help set_permissions' to learn more.

$ 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:

citizix - Rabbitmq Dashboard

citizix – Rabbitmq Dashboard

To use rabbitmqadmin command line tool, copy it to your $PATH.

sudo dnf install -y 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. Use this command to ensure that python is installed:

sudo dnf install -y python3

7. Basic 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

Conclusion

We have managed to install Rabbitmq in this guide

comments powered by Disqus
Citizix Ltd
Built with Hugo
Theme Stack designed by Jimmy