Docker installation and configuration steps for RabbitMQ

Docker installation and configuration steps for RabbitMQ

Single-machine deployment

This article will demonstrate how to install RabbitMQ using Docker on a CentOS 7 system.

Online Pull

RabbitMQ Mirror

docker pull rabbitmq:3-management

注:rabbitmq:3-management是一個基于瀏覽器圖形的管理界面,用于管理、監控rabbitmq的運行情況,它是以插件的形式提供的。

View Mirror

docker images

insert image description here

Create and run RabbitMQ

Create and run RabbitMQ commands:

docker run \
 -e RABBITMQ_DEFAULT_USER=rabbitmq\
 -e RABBITMQ_DEFAULT_PASS=rabbitmq\
 --name RabbitMQ\
 --hostname mq1 \
 -p 15672:15672 \
 -p 5672:5672 \
 -d \
rabbitmq:3-management

Command Explanation:

  • RABBITMQ_DEFAULT_USER=rabbitmq : username
  • RABBITMQ_DEFAULT_PASS=rabbitmq : password
  • In the future, when we visit MQ or log in to the MQ management platform, we will need this account and password.
  • --name RabbitMQ : Define the container name
  • --hostname mq1 : Define the MQ host name
  • -p 15672:15672 : Map port 15672------>RabbitMQ management platform port
  • -p 5672:5672 : Map port 5672------>RabbitMQ message communication port, messages are sent and received through this port
  • -d : run in the background
  • rabbitmq : image name, without version number, defaults to the latest version

Create and run the MQ container successfully

Create Success

insert image description here

View running containers

docker ps

insert image description here

Adding Firewall Rules

Because I use cloud services instead of virtual machines, I need to open ports

insert image description here

Disable Linux firewall:

# Close systemctl stop firewalld
# Disable the firewall from starting up systemctl disable firewalld

Access the RabbitMQ management platform port

Enter in the browser address bar:

Server IP:15672

The account password is defined when the container is created:

## Account rabbitmq
 -e RABBITMQ_DEFAULT_USER=rabbitmq\
 ## Password rabbitmq
 -e RABBITMQ_DEFAULT_PASS=rabbitmq\

insert image description here

Overview

insert image description here

Connections

In the future, both消息發送者and消息接收者will establish a connection with MQ

insert image description here

Channels

Both消息發送者and消息接收者complete the message sending and receiving based on the Channels channel

insert image description here

Exchanges

insert image description here

Queues

The queue is used to store messages.

insert image description here

Users user management

insert image description here

The above are the details of the implementation steps of Docker installation and configuration of RabbitMQ. For more information about Docker installation of RabbitMQ, please pay attention to other related articles on 123WORDPRESS.COM!

You may also be interested in:
  • A detailed introduction to deploying RabbitMQ environment with docker
  • How to deploy rabbitmq cluster with docker
  • How to build a rabbitmq cluster environment with docker
  • Detailed steps to install RabbitMQ in docker

<<:  Detailed explanation of CSS3 elastic expansion box

>>:  A complete list of commonly used HTML tags and their characteristics

Recommend

Detailed explanation of box-sizing in CSS3 (content-box and border-box)

Box-sizing in CSS3 (content-box and border-box) T...

How to deploy Angular project using Docker

There are two ways to deploy Angular projects wit...

Use of Docker image storage overlayfs

1. Overview The image in Docker is designed in la...

MySQL table name case selection

Table of contents 1. Parameters that determine ca...

How to set up automatic daily database backup in Linux

This article takes Centos7.6 system and Oracle11g...

How to migrate local mysql to server database

We can use the scp command of Linux (scp cannot b...

MySQL uses variables to implement various sorting

Core code -- Below I will demonstrate the impleme...

Tips for data statistics in MySQL

As a commonly used database, MySQL requires a lot...

Two implementation solutions for vuex data persistence

Table of contents Business requirements: Solution...

How to use Linux to calculate the disk space occupied by timed files

Open the scheduled task editor. Cent uses vim to ...

Detailed explanation of the difference between uniapp and vue

Table of contents 1. Simple page example 2.uni-ap...

How to pull the docker image to view the version

To view the version and tag of the image, you nee...

Deleting two images with the same id in docker

When I created a Docker container today, I accide...