【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>>
#--restart=always
#-e RABBITMQ_VM_MEMORY_HIGH_WATERMARK=1024MiB
docker run -d \
--name rabbitmq \
--hostname myrabbit \
-e RABBITMQ_DEFAULT_USER=admin \
-e RABBITMQ_DEFAULT_PASS=admin \
-e RABBITMQ_DEFAULT_VHOST=vhost \
-p 15672:15672 \
-p 5672:5672 \
-v /usr/local/rabbitmq:/etc/rabbitmq \
-v /usr/local/rabbitmq/data:/var/lib/rabbitmq \
-v /usr/local/rabbitmq/log/:/var/log/rabbitmq \
rabbitmq:management
docker run -d \
--name rabbitmq \
--hostname myrabbit \
-e RABBITMQ_DEFAULT_USER=xxx\
-e RABBITMQ_DEFAULT_PASS=xxx\
-e RABBITMQ_DEFAULT_VHOST=vhost \
-p 15672:15672 \
-p 5672:5672 \
-v /usr/local/rabbitmq/data:/var/lib/rabbitmq \
-v /usr/local/rabbitmq/log/:/var/log/rabbitmq \
rabbitmq:3.8.2-management
注意: 如果第一次启动成功后,用户信息就保存在了/usr/local/rabbitmq/data 中的, 想要修改密码,先把 ./usr/local/rabbitmq/data 文件删除
容器内的目录:
/var/lib/rabbitmq # ls
config mnesia schema
/var/lib/rabbitmq/config
/var/lib/rabbitmq/mnesia
/var/lib/rabbitmq/schema
loopback_users.guest = false
listeners.tcp.default = 5672
default_pass = xx
default_user = xx
default_vhost = vhost
management.tcp.port = 15672
来源:oschina
链接:https://my.oschina.net/u/2552286/blog/3061180