使用docker部署
docker run -d --hostname my-rabbit --name some-rabbit \
-p 15672:15672 -p 5672:5672 \
-v /usr/local/rabbitmq/data:/var/lib/rabbitmq \
-v /usr/local/rabbitmq/conf:/etc/rabbitmq \
-v /usr/local/rabbitmq/log:/var/log/rabbitmq \
-e RABBITMQ_DEFAULT_USER=admin \
-e RABBITMQ_DEFAULT_PASS=admin \
rabbitmq:3.8-management
使用kubesphere部署
dockerhub
资源分配
端口配置
环境变量
RABBITMQ_DEFAULT_USER
RABBITMQ_DEFAULT_PASS
同步主机时区
存储卷配置
/var/lib/rabbitmq
配置文件子路径挂载
(* 默认使用路径挂载会覆盖容器内所有配置,所以如果只需要覆盖个别配置可以使用子路径)
/etc/rabbitmq/enabled_plugins
enabled_plugins
[rabbitmq_federation_management,rabbitmq_management,rabbitmq_mqtt,rabbitmq_stomp].
安装延迟队列插件
wget https://github.com/rabbitmq/rabbitmq-delayed-message-exchange/releases/download/3.8.17/rabbitmq_delayed_message_exchange-3.8.17.8f537ac.ez
kubectl cp rabbitmq_delayed_message_exchange-3.8.17.8f537ac.ez rabbitmq-0:/plugins -n mall-xian
rabbitmq-plugins enable rabbitmq_delayed_message_exchange
rabbitmq-plugins list
rabbitmqctl list_permissions
# 查看当前用户
w
参考
https://www.cnblogs.com/yang5726685/p/15797001.html
rabbitmq安装使用:https://github.com/xkcoding/spring-boot-demo/tree/master/demo-mq-rabbitmq
rabbitmqctl命令: https://www.rabbitmq.com/rabbitmqctl.8.html