RabbitMQ installed and started via docker

RabbitMQ installed and started via docker

1. Download mirror

docker-hub RabbitMQ:https://hub.docker.com/_/rabbitmq

It is recommended to use rabbitmq:3-management version

docker command:

docker pull rabbitmq:3-management

2. Start the container

docker command:

docker run \
-d \
--hostname mq1 \
--name my-rabbitMQ \
-e RABBITMQ_DEFAULT_USER=root \
-e RABBITMQ_DEFAULT_PASS=123456 \
-p 15672:15672 \
-p 5672:5672 \
rabbitmq:3-management

Command description:

docker run \
-d \ # 后台运行
--hostname mq1 \ # 主机名(非集群可忽略)
--name my-rabbitMQ \	# 容器名称
-e RABBITMQ_DEFAULT_USER=root \		# 默认用户名
-e RABBITMQ_DEFAULT_PASS=123456 \	# 默认密码
-p 15672:15672 \	# 管理页端口映射(宿主端口:容器端口)
-p 5672:5672 \		# 通信端口(宿主端口:容器端口)
rabbitmq:3-management	# 镜像名及版本号

3. Visit the management page

To access port 15672, just enter the ip address of the virtual machine plus the port number in the browser.
For example, mine is 192.168.0.102:15672

The firewall opened this port, but it can still be accessed directly.
The reason is that the docker container mapping port will automatically operate the iptables rules, and the list of open ports on the firewall will not change.

insert image description here
Enter the default username and password set when starting the container

insert image description here

Guess you like

Origin blog.csdn.net/Cey_Tao/article/details/128096851