RabbitMQ is an open source message broker software that originally implemented the Advanced Message Queuing Protocol (AMQP) and has since been extended with a plug-in architecture to support Streaming Text Oriented Messaging Protocol, Message Queuing Telemetry Transport, and other multiple messaging protocols. RabbitMQ is lightweight and easy to deploy on-premises and in the cloud. It can be deployed in distributed and federated configurations to meet high-scale, high-availability requirements.
Features of RabbitMQ includes Asynchronous Messaging, Distributed Deployment, HTTP-API, UI & command line tool for managing and monitoring, Diverse array of tools and plugins, etc.
In this guide, we will install RabbitMQ on a Cloudwafer CentOS 7 server instance.
Deploying your cloud server
If you have not already registered with Cloudwafer, you should begin by getting signed up. Take a moment to create an account after which you can easily deploy your own cloud servers.
Once you have signed up, log into your Cloudwafer Client Area with the password provided in your mail and deploy your Cloudwafer cloud server.
Updating System Packages
It is always recommended that you update the system to the latest packages before beginning any major installations. This is done with the command below:
sudo yum update
Step 1: Install Erlang
RabbitMQ is written in Erlang, so we need to install Erlang before we can proceed with our RabbitMQ installation. Create a file named
/etc/yum.repos.d/rabbitmq_erlang.repo that contains the repository configuration below:
[rabbitmq_erlang] name=rabbitmq_erlang baseurl=https://packagecloud.io/rabbitmq/erlang/el/7/$basearch repo_gpgcheck=1 gpgcheck=0 enabled=1 gpgkey=https://packagecloud.io/rabbitmq/erlang/gpgkey sslverify=1 sslcacert=/etc/pki/tls/certs/ca-bundle.crt metadata_expire=300 [rabbitmq_erlang-source] name=rabbitmq_erlang-source baseurl=https://packagecloud.io/rabbitmq/erlang/el/7/SRPMS repo_gpgcheck=1 gpgcheck=0 enabled=1 gpgkey=https://packagecloud.io/rabbitmq/erlang/gpgkey sslverify=1 sslcacert=/etc/pki/tls/certs/ca-bundle.crt metadata_expire=300
Next, update the local yum cache by running the command below:
sudo yum -q makecache -y --disablerepo='*' --enablerepo='rabbitmq_erlang'
Follow the steps below to install Erlang package from the EPEL Repository:
sudo yum install erlang
Upon completion, you can verify the installation using the command below.
Ctrl+C twice to quit the Erlang shell.
Step 2: Install RabbitMQ Server
The RabbitMQ packages can be installed via a Yum repository available from PackageCloud. First, import the PackageCloud GPG key using the command below:
rpm --import https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
Next, create a new Repository file for RabbitMQ using the command below:
sudo nano /etc/yum.repos.d/packagecloud_rabbitmq_rabbitmq-server.repo
Enter the following in the repo file created:
[rabbitmq_rabbitmq-server] name=rabbitmq_rabbitmq-server baseurl=https://packagecloud.io/rabbitmq/rabbitmq-server/el/7/$basearch repo_gpgcheck=1 gpgcheck=0 enabled=1 gpgkey=https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey sslverify=1 sslcacert=/etc/pki/tls/certs/ca-bundle.crt metadata_expire=300 [rabbitmq_rabbitmq-server-source] name=rabbitmq_rabbitmq-server-source baseurl=https://packagecloud.io/rabbitmq/rabbitmq-server/el/7/SRPMS repo_gpgcheck=1 gpgcheck=0 enabled=1 gpgkey=https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey sslverify=1 sslcacert=/etc/pki/tls/certs/ca-bundle.crt metadata_expire=300
Save the file created before closing.
Step 3: Proceed with Installation of RabbitMQ
This is the last step of the installation process. Issue the command below:
sudo yum -q makecache -y --disablerepo='*' --enablerepo='rabbitmq_rabbitmq-server'
sudo yum install rabbitmq-server
After installation, confirm the version of RabbitMQ installed:
rpm -qi rabbitmq-server
Next, start the RabbitMQ server and enable it to start on system boot:
sudo systemctl start rabbitmq-server.service sudo systemctl enable rabbitmq-server.service
Step 4: Enable and use the RabbitMQ management console
Enable the RabbitMQ management console in order for you to monitor the RabbitMQ server processes from a web browser:
sudo rabbitmq-plugins enable rabbitmq_management
sudo chown -R rabbitmq:rabbitmq /var/lib/rabbitmq/
The Web service should be listening on TCP port 15672. You need to add this port number to your firewall. If you are using CSF, read the guide on adding ports to CSF while for FirewallD, read the guide on adding ports to FirewallD .
Next, you need to create an administrator user account for accessing the RabbitMQ server management console.
sudo rabbitmqctl add_user CloudwaferlabsAdmin cloudwaferlabs sudo rabbitmqctl set_user_tags CloudwaferlabsAdmin administrator sudo rabbitmqctl set_permissions -p / CloudwaferlabsAdmin ".*" ".*" ".*"
Now, visit the following URL: http://[domain-name-or-server-IP]:15672/