Please help us update it! We pay for new and updated articles.
See Vultr's Request for Article (RFA) System for details and include RFA# 987 in your request.
RabbitMQ is a widely used open-source message broker written in the Erlang programming language. As a message-oriented middleware, RabbitMQ can be used to implement the Advanced Message Queuing Protocol (AMQP) on all modern operating systems.
This article explains how to install RabbitMQ on a Vultr CentOS 7 server instance.
Before getting started, you need to:
Use the following commands to update your CentOS 7 system to the latest stable status:
sudo yum install epel-release sudo yum update sudo reboot
Since RabbitMQ is written in Erlang, you need to install Erlang before you can use RabbitMQ:
cd ~ wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm sudo rpm -Uvh erlang-solutions-1.0-1.noarch.rpm sudo yum install erlang
Verify your installation of Erlang:
You will be brought into the Erlang shell which resembles:
Erlang/OTP 18 [erts-7.3] [source-d2a6d81] [64-bit] [async-threads:10] [hipe] [kernel-poll:false] Eshell V7.3 (abort with ^G) 1>
Ctrl+C twice to quit the Erlang shell.
Use the following commands to install the latest version of RabbitMQ which is 3.6.1 at the time of writing:
cd ~ wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.1/rabbitmq-server-3.6.1-1.noarch.rpm sudo rpm --import https://www.rabbitmq.com/rabbitmq-signing-key-public.asc sudo yum install rabbitmq-server-3.6.1-1.noarch.rpm
In order to access the RabbitMQ remote management console, you need to allow inbound TCP traffic on ports 4369, 25672, 5671, 5672, 15672, 61613, 61614, 1883, and 8883.
sudo firewall-cmd --zone=public --permanent --add-port=4369/tcp --add-port=25672/tcp --add-port=5671-5672/tcp --add-port=15672/tcp --add-port=61613-61614/tcp --add-port=1883/tcp --add-port=8883/tcp sudo firewall-cmd --reload
Start the RabbitMQ server and enable it to start on system boot:
sudo systemctl start rabbitmq-server.service sudo systemctl enable rabbitmq-server.service
You can check the status of RabbitMQ with:
sudo rabbitmqctl status
Enable the RabbitMQ management console so that you can monitor the RabbitMQ server processes from a web browser:
sudo rabbitmq-plugins enable rabbitmq_management sudo chown -R rabbitmq:rabbitmq /var/lib/rabbitmq/
Next, you need to setup an administrator user account for accessing the RabbitMQ server management console. In the following commands, "mqadmin" is the administrator's username, "mqadminpassword" is the password. Remember to replace them with your own ones.
sudo rabbitmqctl add_user mqadmin mqadminpassword sudo rabbitmqctl set_user_tags mqadmin administrator sudo rabbitmqctl set_permissions -p / mqadmin ".*" ".*" ".*"
Now, visit the following URL:
Log in with the credentials you had specified earlier. You will be greeted with the RabbitMQ remote management console, where you can learn more about RabbitMQ. Enjoy!