1、[root@192 ~]# docker images 查看镜像
2、使用docker pull rabbitmq:management 拉取镜像
3、运行
[root@192 ~]# docker run -d -p 5672:5672 -p 15672:15672 --name rabbitmq rabbitmq:management
4、http://192.168.242.130:15672/
登录管理后台guest guest
5、查看启动镜像[root@192 ~]# docker ps
6、进入容器内,查看用户
[root@localhost ~]# docker exec -it rabbitmq bash
root@2594228fdf28:/# rabbitmqctl list_users
7、创建用户
root@2594228fdf28:/# rabbitmqctl add_user admin1 123
设置角色
root@2594228fdf28:/# rabbitmqctl set_user_tags admin1 administrator
设置用户权限
root@2594228fdf28:/# rabbitmqctl set_permissions -p "/" admin1 ".*" ".*" ".*"
8、安装插件
上传文件到服务器
拷贝文件到镜像
[root@localhost shLftptemp]# docker cp rabbitmq_delayed_message_exchange-3.8.0.ez 2594228fdf28:/plugins
docker ps 查看镜像
进入容器
[root@localhost shLftptemp]# docker exec -it rabbitmq /bin/bash
在/opt/rabbitmq/plugins 可以找到插件
启用插件报错:
Enabling plugins on node rabbit@2594228fdf28:
rabbitmq_delayed_message_exchange
Error:
Failed to enable some plugins:
rabbitmq_delayed_message_exchange:
Plugin doesn't support current server version. Actual broker version: "3.9.11", supported by the plugin: ["3.7.0-3.7.x",
"3.8.0-3.8.x"]
root@2594228fdf28:/# rabbitmq-plugins enable rabbitmq_delayed_message_exchange
重新下载插件:Community Plugins — RabbitMQ
Releases · rabbitmq/rabbitmq-delayed-message-exchange · GitHub
删除3.8
root@2594228fdf28:/opt/rabbitmq/plugins# rm -rf rabbitmq_delayed_message_exchange-3.8.0.ez
重启RabbitMQ
docker restart rabbitmq