RabbitMQ installation (installation in docker container)

Why use it?

RabbitMQ is an open source message broker and queue server mainly used to deliver messages between different applications. It implements the Advanced Message Queuing Protocol (AMQP) and provides an asynchronous collaboration mechanism to help improve system performance and scalability. The role of RabbitMQ is mainly reflected in the following aspects:

1. Asynchronous processing: By writing messages to the message queue, non-essential business logic can be run asynchronously to speed up response.

2. Peak clipping: When the amount of concurrency is large, RabbitMQ can effectively control the length of the message queue, thereby limiting the number of requests and easing the pressure on the system under high concurrency conditions.

3. Decoupling: RabbitMQ can help achieve decoupling between systems and reduce the coupling between systems. For example, in the order system, the business logic after the user places an order may include deducting inventory, generating documents, sending red envelopes, and sending SMS notifications, etc. Through RabbitMQ, these logics can be split and executed asynchronously to improve system performance. 4. Flexible routing: RabbitMQ supports a variety of message routing methods, such as direct routing (direct), topic routing (topic), etc., which can be flexibly configured according to actual needs.

5. Cross-platform and cross-language: RabbitMQ supports multiple programming languages ​​and platforms. All major programming languages ​​have client libraries that communicate with the agent interface.

6. High availability: RabbitMQ has good scalability and failover capabilities, which can ensure that the system can still run normally in the event of a failure. In short, the role of RabbitMQ is to provide an efficient, reliable, and flexible messaging mechanism to support complex business scenarios and the operation of large-scale systems. By using RabbitMQ, the performance, scalability and stability of the system can be improved, and the coupling between systems can be reduced, allowing developers to focus more on the implementation of business logic.

Install

docker pull rabbitmq:3.8    (版本为:3.8)

Create container:

docker run -di --name=MyRabbitMq -p 15672:15672 -p 5672:5672 -e RABBITMQ_DEFAULT_USER=root -e RABBITMQ_DEFAULT_PASS=root d8ffe4d50229

docker run -di --name=取名称 -p 15672:15672 -p 5672:5672   -e RABBITMQ_DEFAULT_USER=账号  -e RABBITMQ_DEFAULT_PASS=密码  镜像ID或镜像名称
 docker ps   //查看运行中的容器
 docker exec -it 容器id /bin/bash   进入rabbitmq容器
 rabbitmq-plugins enable rabbitmq_management   在容器内安装一个插件
 exit   //退出容器
docker ps

Knowledge points:

15691: It is a graphical interface

5671: It is the interface for receiving and sending messages.

Graphical interface access: http://192.168.56.10:15672/#/

If an error is reported:

If the following error is reported:

docker exec -it 容器id /bin/bash 
cd /etc/rabbitmq/conf.d  --配置文件
ls  --查询
echo management_agent.disable_metrics_collector = false > management_agent.disable_metrics_collector.conf
docker restart 容器ID(或容器名称)

As shown in the picture:

As shown in the picture:

Follow, collect, like, and if you have any questions, you can send a private message to the "door owner": v: z13135361785   

 

Guess you like

Origin blog.csdn.net/m0_55699184/article/details/134601237