How to install RabbitMQ on Ubuntu

28/12/2020

In this post, we will see how we can install one of the most popular asynchronous messaging tools, RabbitMQ. According to their official website: “RabbitMQ is the most widely deployed open source message broker”, but what is messaging and being a message broker? Let’s find out.

Messaging

A message is a way of exchanging information between application, servers and processes. When two applications share data among themselves, they can decide when to react to it when they receive the data. To exchange data effectively, one application should be independent of another application. This independence part is where a message broker comes in.

Message Broker

A message broker is an application which stores messages for an application. Whenever an application wants to send data to another application, the app publishes the message onto the message broker. The message broker then finds out which queue this message belongs to, finds out the apps which are connected to that queue and so, those apps can now consume that message.

The message broker app, like RabbitMQ, is responsible for saving that message until there is a consumer for that message. Queues are just virtually infinite buffers which store message packets.

What is RabbitMQ

RabbitMQ is one of the most widely deployed open source message brokers. It is an implementation of the Advanced Message Queuing Protocol which is an open standard. Let’s get started by installing RabbitMQ on our Ubuntu-based machine.

Installing RabbitMQ

We will begin by updating the Ubuntu’s application toolset:

sudo apt-get update
sudo apt-get -y upgrade

Once this is done, we can enable the RabbitMQ application repository:

echo "deb http://www.rabbitmq.com/debian/ testing main" >> /etc/apt/sources.list

This command won’t produce any output:

Now, we can add the verification key of The RabbitMQ package:

curl http://www.rabbitmq.com/rabbitmq-signing-key-public.asc | sudo apt-key add

This cmmand can take upto a few minutes to complete depending upo on the Internet speed:

We can again run the update command now:

apt-get update

We can now finally move on to downloading and installing RabbitMQ server:

sudo apt-get install rabbitmq-server

Let’s see the output for this command:

If you’re willing to manage maximum number of connection from the launch itself, edit the following RabbitMQ config file:

sudo nano /etc/default/rabbitmq-server

Enabling RabbitMQ Management Console

RabbitMQ Management Console is a very useful web application through which we can achieve many tasks very easily, like:

  • Manage users and their permissions and roles
  • Create new queues
  • Manage queues, monitor their consumption rate etc.
  • Purge data which is currently on queues
  • Send and receive messages
  • Memory usage against each queue and by the overall process

Run the following command to enable the RabbitMQ Management Console:

sudo rabbitmq-plugins enable rabbitmq_management

Once this is done, we can visit the following IP to access the RabbitMQ Management Console:

http://localhost:15672/

Once this is done, we can see that management plugin is enabled and consuole is up on above mentioned URL:

Default credentials for this is guest/guest. You can login and see what all operations we can perform:

Use following commands to manage the RabbitMQ server further:

# To start the service:
service rabbitmq-server start

# To stop the service:
service rabbitmq-server stop

# To restart the service:
service rabbitmq-server restart

# To check the status:
service rabbitmq-server status

Conclusion

In general, no manual configuration will be needed with RabbitMQ as it already comes packaged with production-grade configuration. In this lesson, we learned how we can install RabbitMQ and it’s management console.

ONET IDC thành lập vào năm 2012, là công ty chuyên nghiệp tại Việt Nam trong lĩnh vực cung cấp dịch vụ Hosting, VPS, máy chủ vật lý, dịch vụ Firewall Anti DDoS, SSL… Với 10 năm xây dựng và phát triển, ứng dụng nhiều công nghệ hiện đại, ONET IDC đã giúp hàng ngàn khách hàng tin tưởng lựa chọn, mang lại sự ổn định tuyệt đối cho website của khách hàng để thúc đẩy việc kinh doanh đạt được hiệu quả và thành công.
Bài viết liên quan

Hướng dẫn cấu hình nginx với ssl làm reverse proxy cho graylog

Gray log là 1 công cụ mạnh mẽ để quản lý và phân tích các tệp nhật ký, ở các bài trước mình...
30/12/2020

[BigBlueButton] [HDSD-3] Các thao tác của người tham gia phòng họp trên BigBlueButton

Ở bài trước, Onet đã hướng dẫn các bạn các thao tác của người điều hành phòng trên BigBlueButton. Trong...
30/12/2020

SỰ KHÁC BIỆT GIỮA RESIDENTIAL PROXY VÀ PROXY DATACENTER

SỰ KHÁC BIỆT GIỮA RESIDENTIAL PROXY VÀ PROXY DATACENTER Residential (Dân Cư) và Datacenter là 2 loại Proxy...
17/02/2024
Bài Viết

Bài Viết Mới Cập Nhật

Mua Proxy V6 Nuôi Facebook Spam Hiệu Quả Tại Onetcomvn
03/06/2024

Hướng dẫn cách sử dụng ProxyDroid để duyệt web ẩn danh
03/06/2024

Mua proxy Onet uy tín tại Onet.com.vn
03/06/2024

Thuê mua IPv4 giá rẻ, tốc độ nhanh, uy tín #1
28/05/2024

Thuê địa chỉ IPv4 IPv6 trọn gói ở đâu chất lượng, giá RẺ nhất?
27/05/2024