Docker简单部署RabbitMq[单机]

文章目录

    • 1. 拉取镜像
    • 2. 运行容器
      • 1. 默认配置
      • 2. 手动配置账号密码
    • 3. 开放防火墙
    • 4. 访问浏览器客户端

1. 拉取镜像

docker pull rabbitmq:management

2. 运行容器

1. 默认配置

账号密码 guest/guest
端口:15672为浏览器端口
端口:5672为MQ服务端口

docker run  --name rabbitmq -p 15672:15672 -p 5672:5672 rabbitmq:management

2. 手动配置账号密码

docker run -d -p 15672:15672  -p  5672:5672  -e RABBITMQ_DEFAULT_USER=root -e RABBITMQ_DEFAULT_PASS=123456 --name rabbitmq rabbitmq:management
[root@master01 /]# docker run -d -p 15672:15672  -p  5672:5672  -e RABBITMQ_DEFAULT_USER=root -e RABBITMQ_DEFAULT_PASS=123456 --name rabbitmq rabbitmq:management
4dba2864f3dd89d3e1ae7f863a3764b0b717904626cd261c6daee9c7778f0bb9

3. 开放防火墙

status firewalld
firewall-cmd --permanent --zone=public --add-port=5672/tcp
firewall-cmd --permanent --zone=public --add-port=15672/tcp
firewall-cmd --reload
firewall-cmd --permanent --zone=public --list-port
[root@master01 /]# systemctl status firewalld #查看防火墙状态
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: active (running) since 三 2022-12-14 22:02:21 CST; 25min ago
     Docs: man:firewalld(1)
 Main PID: 675 (firewalld)
    Tasks: 2
   Memory: 872.0K
   CGroup: /system.slice/firewalld.service
           └─675 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid

1214 22:04:41 master01 firewalld[675]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -t filter -F DOCKER' failed: iptables:...t name.
1214 22:04:41 master01 firewalld[675]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -t filter -X DOCKER' failed: iptables:...t name.
1214 22:04:41 master01 firewalld[675]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -t filter -F DOCKER-ISOLATION-STAGE-1'...t name.
1214 22:04:41 master01 firewalld[675]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -t filter -X DOCKER-ISOLATION-STAGE-1'...t name.
1214 22:04:41 master01 firewalld[675]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -t filter -F DOCKER-ISOLATION-STAGE-2'...t name.
1214 22:04:41 master01 firewalld[675]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -t filter -X DOCKER-ISOLATION-STAGE-2'...t name.
1214 22:04:41 master01 firewalld[675]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -t filter -F DOCKER-ISOLATION' failed:...t name.
1214 22:04:41 master01 firewalld[675]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -t filter -X DOCKER-ISOLATION' failed:...t name.
1214 22:04:41 master01 firewalld[675]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -D FORWARD -i docker0 -o docker0 -j DR...hain?).
12月 14 22:04:42 master01 firewalld[675]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -D FORWARD -i docker0 -o docker0 -j DR...hain?).
Hint: Some lines were ellipsized, use -l to show in full.
[root@master01 /]# firewall-cmd --permanent --zone=public --add-port=5672/tcp
success
[root@master01 /]# firewall-cmd --permanent --zone=public --add-port=15672/tcp
success
[root@master01 /]# firewall-cmd --reload
success
[root@master01 /]# firewall-cmd --permanent --zone=public --list-port
8848/tcp 5672/tcp 15672/tcp

4. 访问浏览器客户端

http://ip:15672
Docker简单部署RabbitMq[单机]_第1张图片

你可能感兴趣的:(服务器,Docker,rabbitmq,docker,分布式)