一、拉取RabbitMQ镜像文件
# 官网:https://www.rabbitmq.com/networking.html
[root@testtech2-180 ~]# docker pull rabbitmq:management
二、启动 RabbitMQ
[root@testtech2-180 ~]# docker run -itd \
--name rabbitmq \
-p 5671:5671 \
-p 5672:5672 \
-p 4369:4369 \
-p 25672:25672 \
-p 15671:15671 \
-p 15672:15672 \
--restart=always \
rabbitmq:management
# 端口释义:
4369, 25672 (Erlang发现&集群端口)
5672, 5671 (AMQP端口[服务端口])
15672 (web管理后台端口)
61613, 61614 (STOMP协议端口)
1883, 8883 (MQTT协议端口)
三、验证RabbitMQ
[root@testtech2-180 ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
76a562b2b7f9 rabbitmq:management "docker-entrypoint..." 3 days ago Up 3 days 0.0.0.0:4369->4369/tcp, 0.0.0.0:5671-5672->5671-5672/tcp, 0.0.0.0:15671-15672->15671-15672/tcp, 0.0.0.0:25672->25672/tcp, 15691-15692/tcp rabbitmq
四、打印RabbitMQ日志信息
[root@testtech2-180 ~]# docker logs rabbitmq
五、登录RabbitMQ管理界面
URL:IP+15672
默认账号名密码:guest