目录
步骤五、访问地址:http://linuxip地址:15672
1.背景
docker的安装可以查看:https://blog.csdn.net/zhishidi/article/details/119187422
2.安装步骤
步骤一、查看RabbitMQ在仓库中的镜像
docker search rabbitmq
步骤二、拉取RabbitMQ镜像
docker pull rabbitmq
步骤三、启动RabbitMQ
docker run -d --hostname my-rabbit --name rabbit -p 15672:15672 -p 5672:5672 rabbitmq
步骤四、安装插件
1.先执行docker ps 拿到当前的镜像ID
2.进入容器,docker exec -it 镜像ID /bin/bash
3.安装插件,rabbitmq-plugins enable rabbitmq_management
4.ctrl+p+q退出当前容器
步骤五、访问地址:http://linuxip地址:15672
这里的用户名和密码默认都是guest
步骤六、添加管理员账号密码
root@my-rabbit:/# rabbitmqctl add_user admin 123456
Adding user "admin" ...
Done. Don't forget to grant the user permissions to some virtual hosts! See 'rabbitmqctl help set_permissions' to learn more.
root@my-rabbit:/# rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"
Setting permissions for user "admin" in vhost "/" ...
root@my-rabbit:/# rabbitmqctl set_user_tags admin administrator
Setting tags for user "admin" to [administrator] ...
root@my-rabbit:/#