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

Several common ways to deploy Tomcat projects [tested]

1 / Copy the web project files directly to the we...

Why is it not recommended to use index as key in react?

1. Compare the old virtual DOM with the new virtu...

js+Html to realize table editable operation

This article shares the specific code of js+Html ...

How to handle spaces in CSS

1. Space rules Whitespace within HTML code is usu...

Detailed explanation of JavaScript's garbage collection mechanism

Table of contents Why do we need garbage collecti...

JS implements array filtering from simple to multi-condition filtering

Table of contents Single condition single data fi...

User experience of portal website redesign

<br />From the launch of NetEase's new h...

Detailed explanation of common methods of Vue development

Table of contents $nextTick() $forceUpdate() $set...

Using Openlayer in Vue to realize loading animation effect

Note: You cannot use scoped animations! ! ! ! via...

Windows Service 2016 Datacenter\Stand\Embedded Activation Method (2021)

Run cmd with administrator privileges slmgr /ipk ...

How to prevent website content from being included in search engines

Usually the goal of building a website is to have...

How to optimize MySQL performance through MySQL slow query

As the number of visits increases, the pressure o...

Overview of MySQL Statistics

MySQL executes SQL through the process of SQL par...