1. 程式人生 > >docker-compose安裝rabbitmq 叢集和管理工具

docker-compose安裝rabbitmq 叢集和管理工具

單機版

rabbit1:
  image: rabbitmq:management
  hostname: rabbit1
  ports:
    - "4369:4369"
    - "5671:5671"
    - "5672:5672"
    - "15671:15671"
    - "15672:15672"
  environment:
    - RABBITMQ_DEFAULT_USER=teleinfo
    - RABBITMQ_DEFAULT_PASS=123456

叢集版

rabbit1:
  image: bijukunjummen/rabbitmq-server:3.7.0
  hostname: rabbit1
  ports:
    - "5672:5672"
- "15672:15672" environment: - RABBITMQ_DEFAULT_USER=myuser - RABBITMQ_DEFAULT_PASS=mypass rabbit2: image: bijukunjummen/rabbitmq-server:3.7.0 hostname: rabbit2 links: - rabbit1 environment: - CLUSTERED=true - CLUSTER_WITH=rabbit1 - RAM_NODE=true ports: - "5673:5672"
- "15673:15672" rabbit3: image: bijukunjummen/rabbitmq-server:3.7.0 hostname: rabbit3 links: - rabbit1 - rabbit2 environment: - CLUSTERED=true - CLUSTER_WITH=rabbit1 ports: - "5674:5672"