docker 安装RabbitMQ

3月前 ⋅ 55 阅读

安装目录:

-rabbitmq

    -docker-compose.yml

    -data

docker-compose.yml内容如下:

version: "3"
services: 
  rabbitmq:
    image: rabbitmq:3.7-rc
    ports:
      - "5672:5672"
      - "15672:15672"
    restart: "always"
    container_name: 5672.rabbitmq
    volumes:  
      - ./data:/var/lib/rabbitmq
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro
    environment:
      - RABBITMQ_DEFAULT_VHOST=my_vhost
      - RABBITMQ_DEFAULT_USER=admin
      - RABBITMQ_DEFAULT_PASS=admin

进入到rabbitmq目录下,执行命令:

docker-compose -f docker-compose.yml up -d

进容器,执行
rabbitmq-plugins enable rabbitmq_management

rabbitmqctl add_user admin admin

rabbitmqctl set_user_tags admin administrator

转载于:https://my.oschina.net/yq0128/blog/3066800


全部评论: 0

    我有话说: