RabbitMQ is a message broker for the messaging protocols. RabbitMQ supports Advanced Message Queuing Protocol (AMQP). Message brokers in computer networks are software applications to communicate by exchanging formally-defined messages over protocols for the message-oriented middleware. Previously we talked about Apache Kafka, that is basically similar type of software. Here are the steps on how to install RabbitMQ on Ubuntu 16.04 LTS server over SSH. These message brokers can act like a middleman for various services like web application to communicate between various servers and devices. RabbitMQ offers an interface, connecting message senders with receivers through an exchange.
How To Install RabbitMQ on Ubuntu 16.04 LTS
It is practical to use a blank cloud server or other type of virtual server. First SSH to the server, then run the commands as root user. Run update, upgrade :
1 2 | apt update apt upgrade |
Add the public keys :
---
1 2 3 4 | wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | sudo apt-key add - wget -O- https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc | sudo apt-key add - |
Run the following command to add the APT repository to /etc/apt/sources.list.d
:
1 2 | echo 'deb http://www.rabbitmq.com/debian/ testing main' | sudo tee /etc/apt/sources.list.d/rabbitmq.list |
Run update :
1 | apt update |
RabbitMQ needs Erlang/OTP to run. We have to go to the official repo :
1 | https://packages.erlang-solutions.com/ |
Find the latest stable release, wget it and install. For example :
1 2 3 4 | wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb sudo dpkg -i erlang-solutions_1.0_all.deb apt update apt install erlang erlang-nox |
Now install RabbitMQ :
1 | sudo install rabbitmq-server |
Run :
1 2 3 | sudo systemctl enable rabbitmq-server sudo systemctl start rabbitmq-server service rabbitmq-server status |
By default, RabbitMQ have a user named guest with password guest. We will create own administrator account on RabbitMQ server, change password :
1 2 3 | sudo rabbitmqctl add_user admin password sudo rabbitmqctl set_user_tags admin administrator sudo rabbitmqctl set_permissions -p / admin ".*" ".*" ".*" |
RabbitMQ has a web management console. To enable web management console run :
1 | sudo rabbitmq-plugins enable rabbitmq_management |
By default the port is 15672
. If you go to http://your.IP.address:15672/
, you’ll get the admin interface.
guest
is the default username and password is also guest
.
The OS limits are controlled via a configuration file at /etc/systemd/system/rabbitmq-server.service.d/limits.conf
, for example:
1 2 | [Service] LimitNOFILE=300000 |
RabbitMQ website has huge documentation. It is practical to read them for the intended purpose to change any default settings or know the ports. For example, here is documentation on plugins :
1 | https://www.rabbitmq.com/management.html |