How to install RabbitMQ in OpenSUSE Leap 15.3

In this guide we will explore how to install the latest release of RabbitMQ in OpenSUSE Leap 15.3 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 OpenSUSE Leap server/workstation
  • Access to the internet
  • Root access or user with Sudo access

Table of Content

  1. Updating the system
  2. Installing Erlang
  3. Installing RabbitMQ
  4. Starting and enabling rabbitmq-server service
  5. Optional: Enabling RabbitMQ Dashboard
  6. 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 zypper ref
sudo zypper up -y

2. Installing Erlang

The RabbitMQ package is found in the default OpenSUSE repos. Install it using this command:

sudo zypper install -y erlang

This is the output on my server

~> sudo zypper install -y erlang
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following recommended package was automatically selected:
  psqlODBC

The following 6 NEW packages are going to be installed:
  erlang erlang-epmd libltdl7 libpq5 psqlODBC unixODBC

6 new packages to install.
Overall download size: 28.9 MiB. Already cached: 0 B. After the operation, additional 52.3 MiB will be used.
Continue? [y/n/v/...? shows all options] (y): y
Retrieving package libltdl7-2.4.6-3.4.1.x86_64                                                   (1/6),  32.6 KiB ( 38.6 KiB unpacked)
Retrieving: libltdl7-2.4.6-3.4.1.x86_64.rpm ....................................................................................[done]
Retrieving package libpq5-14.0-5.3.1.x86_64                                                      (2/6), 172.2 KiB (679.2 KiB unpacked)
Retrieving: libpq5-14.0-5.3.1.x86_64.rpm .......................................................................................[done]
Retrieving package unixODBC-2.3.6-3.2.1.x86_64                                                   (3/6), 306.1 KiB (  1.0 MiB unpacked)
Retrieving: unixODBC-2.3.6-3.2.1.x86_64.rpm ....................................................................................[done]
Retrieving package psqlODBC-13.01.0000-3.9.1.x86_64                                              (4/6), 405.1 KiB (  1.3 MiB unpacked)
Retrieving: psqlODBC-13.01.0000-3.9.1.x86_64.rpm ..................................................................[done (16.3 KiB/s)]
Retrieving package erlang-22.3-1.26.x86_64                                                       (5/6),  27.9 MiB ( 49.2 MiB unpacked)
Retrieving: erlang-22.3-1.26.x86_64.rpm ...........................................................................[done (29.6 MiB/s)]
Retrieving package erlang-epmd-22.3-1.26.x86_64                                                  (6/6), 145.4 KiB ( 55.3 KiB unpacked)
Retrieving: erlang-epmd-22.3-1.26.x86_64.rpm ......................................................................[done (16.4 KiB/s)]

Checking for file conflicts: ...................................................................................................[done]
(1/6) Installing: libltdl7-2.4.6-3.4.1.x86_64 ..................................................................................[done]
(2/6) Installing: libpq5-14.0-5.3.1.x86_64 .....................................................................................[done]
(3/6) Installing: unixODBC-2.3.6-3.2.1.x86_64 ..................................................................................[done]
(4/6) Installing: psqlODBC-13.01.0000-3.9.1.x86_64 .............................................................................[done]
Additional rpm output:
odbcinst: Driver installed. Usage count increased to 1.
    Target directory is /etc/unixODBC


(5/6) Installing: erlang-22.3-1.26.x86_64 ......................................................................................[done]
(6/6) Installing: erlang-epmd-22.3-1.26.x86_64 .................................................................................[done]
Additional rpm output:
Created symlink /etc/systemd/system/sockets.target.wants/epmd.socket -> /usr/lib/systemd/system/epmd.socket.

4. Installing Rabbitmq

RabbitMQ can be found in the default OpenSUSE repos. Install using this command:

sudo zypper install -y rabbitmq-server

You should see an output similar to this:

~> sudo zypper install -y rabbitmq-server
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following 3 NEW packages are going to be installed:
  rabbitmq-server rabbitmq-server-plugins socat

3 new packages to install.
Overall download size: 15.2 MiB. Already cached: 0 B. After the operation, additional 16.4 MiB will be used.
Continue? [y/n/v/...? shows all options] (y): y
Retrieving package socat-1.7.3.2-4.10.x86_64                                                     (1/3), 227.4 KiB (710.5 KiB unpacked)
Retrieving: socat-1.7.3.2-4.10.x86_64.rpm ......................................................................................[done]
Retrieving package rabbitmq-server-plugins-3.8.11-3.3.3.x86_64                                   (2/3),   3.6 MiB (  3.7 MiB unpacked)
Retrieving: rabbitmq-server-plugins-3.8.11-3.3.3.x86_64.rpm ..........................................................[done (954 B/s)]
Retrieving package rabbitmq-server-3.8.11-3.3.3.x86_64                                           (3/3),  11.4 MiB ( 12.0 MiB unpacked)
Retrieving: rabbitmq-server-3.8.11-3.3.3.x86_64.rpm ...............................................................[done (16.6 KiB/s)]

Checking for file conflicts: ...................................................................................................[done]
(1/3) Installing: socat-1.7.3.2-4.10.x86_64 ....................................................................................[done]
(2/3) Installing: rabbitmq-server-plugins-3.8.11-3.3.3.x86_64 ..................................................................[done]
(3/3) Installing: rabbitmq-server-3.8.11-3.3.3.x86_64 ..........................................................................[done]

Package details can be queried using rpm command with the option -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 Sun 2021-11-14 17:46:33 UTC; 10s ago
   Main PID: 2478 (beam.smp)
     Status: "Initialized"
      Tasks: 24 (limit: 8192)
     CGroup: /system.slice/rabbitmq-server.service
             ├─2474 /bin/sh /usr/sbin/rabbitmq-server
             ├─2478 /usr/lib64/erlang/erts-10.7/bin/beam.smp -W w -MBas ageffcbf -MHas ageffcbf -MBlmbcs 512 -MHlmbcs 512 -MMmcs 30 -P 1048576 -t 5000000 -stbt db -zdbbl 128>
             ├─2489 erl_child_setup 65535
             ├─2538 inet_gethost 4
             └─2539 inet_gethost 4

Nov 14 17:46:26 ip-10-2-40-188 systemd[1]: Starting RabbitMQ broker...
Nov 14 17:46:33 ip-10-2-40-188 systemd[1]: rabbitmq-server.service: Supervising process 2478 which is not our child. We'll most likely not notice when it exits.
Nov 14 17:46:33 ip-10-2-40-188 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@localhost:
rabbitmq_management
The following plugins have been configured:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_web_dispatch
Applying plugin configuration to rabbit@localhost...
The following plugins have been enabled:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_web_dispatch

set 3 plugins.
Offline change; changes will take effect at broker restart.

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

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