使用docker部署

  1. docker run -d --hostname my-rabbit --name some-rabbit \
  2. -p 15672:15672 -p 5672:5672 \
  3. -v /usr/local/rabbitmq/data:/var/lib/rabbitmq \
  4. -v /usr/local/rabbitmq/conf:/etc/rabbitmq \
  5. -v /usr/local/rabbitmq/log:/var/log/rabbitmq \
  6. -e RABBITMQ_DEFAULT_USER=admin \
  7. -e RABBITMQ_DEFAULT_PASS=admin \
  8. rabbitmq:3.8-management

使用kubesphere部署

dockerhub

rabbitmq:3.8-management

资源分配

image.png

端口配置

image.png

环境变量

RABBITMQ_DEFAULT_USER
RABBITMQ_DEFAULT_PASS
image.png

同步主机时区

image.png

存储卷配置

/var/lib/rabbitmq
image.png

配置文件子路径挂载

* 默认使用路径挂载会覆盖容器内所有配置,所以如果只需要覆盖个别配置可以使用子路径)

/etc/rabbitmq/enabled_plugins

image.png

enabled_plugins

  1. [rabbitmq_federation_management,rabbitmq_management,rabbitmq_mqtt,rabbitmq_stomp].

安装延迟队列插件

  1. wget https://github.com/rabbitmq/rabbitmq-delayed-message-exchange/releases/download/3.8.17/rabbitmq_delayed_message_exchange-3.8.17.8f537ac.ez
  2. kubectl cp rabbitmq_delayed_message_exchange-3.8.17.8f537ac.ez rabbitmq-0:/plugins -n mall-xian
  3. rabbitmq-plugins enable rabbitmq_delayed_message_exchange
  4. rabbitmq-plugins list
  5. rabbitmqctl list_permissions
  6. # 查看当前用户
  7. 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