In this tutorial, we will show you how to install and configuration of RabbitMQ on your CentOS 7 server. For those of you who didn’t know, RabbitMQ is open-source message broker software (sometimes called message-oriented middleware) that implements the Advanced Message Queuing Protocol (AMQP). The RabbitMQ server is written in the Erlang programming language and is built on the Open Telecom Platform framework for clustering and failover. Client libraries to interface with the broker are available for all major programming languages.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step installation of RabbitMQ on a CentOS 7 server.
Prerequisites
- A server running one of the following operating systems: CentOS 7.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install RabbitMQ in CentOS 7
Step 1. First, let’s start by ensuring your system is up-to-date.
yum -y update
Step 2. Installing Erlang.
Install Erlang using the command:
wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm rpm -Uvh erlang-solutions-1.0-1.noarch.rpm yum install erlang
Step 3. Installing RabbitMQ.
The first thing to do is to go to RabbitMQ’s download page and download the latest stable version of RabbitMQ, At the moment of writing this article it is version 3.6.1:
wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.1/rabbitmq-server-3.6.1-1.noarch.rpm rpm --import https://www.rabbitmq.com/rabbitmq-signing-key-public.asc
Installing RabbitMQ and related packages are now as simple as running just one command:
yum install rabbitmq-server-3.6.1-1.noarch.rpm
To start, stop, restart, and check the RabbitMQ status, use the following:
# To start enable boot service: systemctl enable rabbitmq-server # To start the service: systemctl start rabbitmq-server # To stop the service: systemctl stop rabbitmq-server # To restart the service: systemctl restart rabbitmq-server # To check the status: systemctl status rabbitmq-server
Step 4. Configuring SELinux and Firewall.
We must allow the following ports via SELinux, and Firewall in order to access RabbitMQ remote management console from the remote systems:
firewall-cmd --permanent --add-port=4369/tcp firewall-cmd --permanent --add-port=25672/tcp firewall-cmd --permanent --add-port=5671-5672/tcp firewall-cmd --permanent --add-port=15672/tcp firewall-cmd --permanent --add-port=61613-61614/tcp firewall-cmd --permanent --add-port=8883/tcp firewall-cmd --reload setsebool -P nis_enabled 1
Step 5. Access the RabbitMQ management console.
The rabbitMQ management console will allow you to monitor the server processes via a web browser:
rabbitmq-plugins enable rabbitmq_management chown -R rabbitmq:rabbitmq /var/lib/rabbitmq/
RabbitMQ will be available on HTTP port 15672 by default. Open your favorite browser and navigate to http://yourdomain.com:15672
or http://your-server-ip:15672
and complete the required steps to finish the installation.
Congratulations! You have successfully installed the RabbitMQ server. Thanks for using this tutorial for installing RabbitMQ on CentOS 7 system. For additional help or useful information, we recommend you check the official RabbitMQ website.