当前位置:   article > 正文

Docker-compose安装RabbitMQ、安装插件_docker-compose rabbitmq 安装插件

docker-compose rabbitmq 安装插件

Docker-compose安装RabbitMQ

1.安装Docker,dockercompose

2.新建启动配置文件

[root@rabbitmq63 dockercompose]# cat deploy_rabbimq.sh
#/bin/bash
case "$1" in
"restart")
docker ps -a | grep rabbitmq | awk '{print $1}'|xargs docker stop
docker-compose -f rabbimq_deploy.yaml up -d
;;
*)
docker ps -a | grep rabbitmq | awk '{print $1}'|xargs docker stop
docker ps -a | grep rabbitmq | awk '{print $1}'|xargs docker rm
docker-compose -f rabbimq_deploy.yaml up -d
;;
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
[root@rabbitmq63 dockercompose]# cat rabbimq_deploy.yaml
version: '3.7'
services:
  rabbitmq:
    image: rabbitmq:3.10-management
    container_name: rabbitmq
    restart: always
    privileged: true
    networks:
      mq-net:
        ipv4_address: 172.27.10.10
    environment:
     - 'RABBITMQ_DEFAULT_USER=guest'
     - 'RABBITMQ_DEFAULT_PASS=guest'
    volumes:
      - /usr/local/rabbitmq/data:/var/lib/rabbitmq/
    ports:
      - 5672:5672
      - 15672:15672

networks:
  mq-net:
    driver: bridge
    ipam:
      config:
        - subnet: 172.27.10.0/24
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26

3.启动

./deploy_rabbimq.sh
  • 1

安装插件

delayed_message

delayed_message插件地址:https://github.com/rabbitmq/rabbitmq-delayed-message-exchange/releases/download/3.10.2/rabbitmq_delayed_message_exchange-3.10.2.ez

安装

● 容器内部查看已有插件列表

rabbitmq-plugins list
  • 1

● 容器内部查看插件目录

rabbitmq-plugins directories -s 
  • 1

●查看插件目录

root@rabbitmq-6bff494979-4jhtw:~# rabbitmq-plugins directories -s 
Plugin archives directory: /opt/rabbitmq/plugins
Plugin expansion directory: /var/lib/rabbitmq/mnesia/rabbit@rabbitmq-6bff494979-4jhtw-plugins-expand
Enabled plugins file: /etc/rabbitmq/enabled_plugin
  • 1
  • 2
  • 3
  • 4

● 上传插件

docker cp /root/rabbitmq_delayed_message_exchange-3.10.2.ez 3d135065aa9b:/opt/rabbitmq/plugins
  • 1

● 容器内部启动插件

rabbitmq-plugins enable rabbitmq_delayed_message_exchange
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/代码探险家/article/detail/902661
推荐阅读
相关标签
  

闽ICP备14008679号