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

Use of Linux date command

1. Command Introduction The date command is used ...

MySQL 8.0.17 installation and configuration method graphic tutorial

This article shares the installation and configur...

Tips for data statistics in MySQL

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

Explanation of the precautions for Mysql master-slave replication

1. Error error connecting to master 'x@xxxx:x...

Mysql SQL statement operation to add or modify primary key

Add table fields alter table table1 add transacto...

Example of adding multi-language function to Vue background management

Table of contents 1. First, configure the main.js...

CSS eight eye-catching HOVER effect sample code

1. Send effect HTML <div id="send-btn&quo...

Sharing some details about MySQL indexes

A few days ago, a colleague asked me a question a...

What are the differences between sql and mysql

What is SQL? SQL is a language used to operate da...

MySQL variable declaration and stored procedure analysis

Declaring variables Setting Global Variables set ...

vue $set implements assignment of values ​​to array collection objects

Vue $set array collection object assignment In th...

22 Vue optimization tips (project practical)

Table of contents Code Optimization Using key in ...