RabbitMQ
RHEL
Server Installation
Linux
System Administration

Installing rabbitmq-server on RHEL

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

RabbitMQ is a popular open-source message broker used widely for queueing, distributing, and managing asynchronous communication in diverse software and web applications. Installing RabbitMQ on a Red Hat Enterprise Linux (RHEL) system involves several steps, mainly because it requires the Erlang programming language environment to run. Here is a step-by-step guide on how to install rabbitmq-server on RHEL.

Prerequisites

Before installing RabbitMQ, ensure your RHEL system meets the following requirements:

  • Network Connectivity: Required for downloading packages.
  • Root or Sudo Privileges: Necessary for installing packages system-wide.
  • Erlang: RabbitMQ requires Erlang to be installed.

Step 1: Install Erlang

RabbitMQ requires the Erlang runtime. You can install Erlang through the EPEL repository or using Erlang Solutions repo, which tends to offer more updated versions.

  1. Add the EPEL repository:
bash
   sudo yum install -y epel-release
  1. Install Erlang from Erlang Solutions:
bash
   sudo wget https://packages.erlang-solutions.com/erlang-solutions-2.0-1.noarch.rpm
   sudo rpm -Uvh erlang-solutions-2.0-1.noarch.rpm
   sudo yum install -y erlang

Step 2: Add the RabbitMQ Repository

With Erlang installed, the next step is to add the RabbitMQ repository to your system.

bash
sudo wget https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh
sudo chmod +x script.rpm.sh
sudo ./script.rpm.sh

Step 3: Install RabbitMQ Server

Now, install the RabbitMQ server using yum:

bash
sudo yum install rabbitmq-server -y

Step 4: Enable and Start RabbitMQ Service

After installation, you should enable and start the RabbitMQ service:

bash
sudo systemctl enable rabbitmq-server
sudo systemctl start rabbitmq-server

Step 5: Check Service Status

To confirm that RabbitMQ is running, you can check the status of the service:

bash
sudo systemctl status rabbitmq-server

Step 6: Enable RabbitMQ Management Console (Optional)

The RabbitMQ Management Plugin provides a user-friendly interface to manage the server. To enable it, run:

bash
sudo rabbitmq-plugins enable rabbitmq_management

The management console is available on port 15672 of your server. You can access it via http://your-server-ip:15672.

Securing RabbitMQ

  • Change Default User Credentials: By default, RabbitMQ comes with a user named "guest" with full privileges, accessible from localhost only. Change these defaults and set strong passwords.
  • Firewall Configuration: Adjust the firewall settings to control access to the RabbitMQ service especially if it's exposed over the network.
  • SSL/TLS Configuration: For production environments, configure SSL/TLS to ensure that all data transmitted to and from the RabbitMQ server is encrypted.

Summary Table

TaskCommand/InstructionRemarks
Install Erlangsudo yum install -y erlangRequires EPEL and Erlang repo
Add RabbitMQ repositoryExecute the shell script from packagecloud-
Install RabbitMQsudo yum install rabbitmq-server -y-
Start and enable RabbitMQ servicesudo systemctl enable/start rabbitmq-serverEnable to start at boot
Enable RabbitMQ Management Consolesudo rabbitmq-plugins enable rabbitmq_managementAccess via port 15672
Securing RabbitMQChange default user credentials and configure SSL/TLSEnsure security best practices

Additional Resources

For further customization and advanced configurations refer to the official RabbitMQ documentation or the RHEL-specific guides which can provide insights tailored to enterprise environments.

With this setup, you now have a basic RabbitMQ server running on RHEL. This setup is suitable for development or small production environments. For larger setups, consider clustering RabbitMQ, tuning it for performance, and securing network communications.


Related reading
Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

All Rights Reserved.