Docker安装RabbitMQ镜像

**步骤1:**拉取镜像

bash 复制代码
docker pull rabbitmq:management

**步骤2:**运行

bash 复制代码
docker run -d ---name rabbit -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=admin -p 15672:15672 -p 5672:5672 -p 25672:25672 -p 61613:61613 -p 1883:1883 rabbitmq:management

-e:设置环境变量:

RABBITMQ_DEFAULT_USER:指定web管理平台的用户名

RABBITMQ_DEFAULT_PASS:指定web管理平台的用户名
如果不指定,则默认使用guest/guest(默认guest无法远程登陆,只能localhost:15672登陆)

小插曲:

bash 复制代码
docker: Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:61613 -> 0.0.0.0:0: listen tcp 0.0.0.0:61613: bind: An attempt was made to access a socket in a way forbidden by its access permissions.

以管理员身份运行一下命令,然后再执行docker run命令即可

net stop winnat

net start winnat

成功

应用连接报错:

ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile

目前还没有解决

关于rabbitmq用户设置tag说明:

management

User can access the management plugin

policymaker

User can access the management plugin and manage policies and parameters for the vhosts they have access to.

monitoring

User can access the management plugin and see all connections and channels as well as node-related information.

administrator

User can do everything monitoring can do, manage users, vhosts and permissions, close other user's connections, and manage policies and parameters for all vhosts.

bash 复制代码
# Don't forget to grant the user permissions to some virtual hosts!
rabbitmqctl help set_permissions

# 新增用户
rabbitmqctl add_user YOUR_USERNAME YOUR_PASSWORD

# Setting tags for user "admin" to [administrator]
rabbitmqctl set_user_tags YOUR_USERNAME administrator

# Setting permissions for user "admin" in vhost "/"
rabbitmqctl set_permissions -p / YOUR_USERNAME ".*" ".*" ".*"

# 删除用户
rabbitmqctl delete_user YOUR_USERNAME
相关推荐
梁萌2 小时前
Linux安装Docker
linux·运维·docker·helloworld·容器化部署
翱翔-蓝天2 小时前
在 CentOS 系统上安装 ClickHouse
运维·docker·容器
SRExianxian3 小时前
kubernetes存储架构之PV controller源码解读
容器·架构·kubernetes
cdg==吃蛋糕5 小时前
docker代理配置
docker·容器·eureka
web135085886356 小时前
使用docker compose安装gitlab
docker·容器·gitlab
IT机器猫6 小时前
Docker完整技术汇总
运维·docker·容器
董健正6 小时前
Docker安装
docker·容器·docker-compose
gs801407 小时前
替换 Docker.io 的 Harbor 安全部署指南:域名与 IP 双支持的镜像管理解决方案
docker·harbor
coco_1998_27 小时前
nvidia docker, nvidia docker2, nvidia container toolkits区别
docker·容器
团儿.7 小时前
Docker服务发现新纪元:探索Consul的无限魅力
运维·docker·云计算·服务发现·consul