1、新建docker-compose.yml
version: '3.5'
services:
rmqnamesrv:
image: rocketmqinc/rocketmq
container_name: rmqnamesrv
restart: always
ports:
- 9876:9876
environment:
#内存分配
JAVA_OPT_EXT: "-server -Xms256m -Xmx256m"
volumes:
- ./logs:/root/logs
command: sh mqnamesrv
networks:
rmq:
aliases:
- rmqnamesrv
rmqbroker:
image: rocketmqinc/rocketmq
container_name: rmqbroker
restart: always
depends_on:
- rmqnamesrv
ports:
- 10909:10909
- 10911:10911
volumes:
- ./logs:/root/logs
- ./store:/root/store
- ./conf/broker.conf:/opt/rocketmq-4.4.0/conf/broker.conf
command: sh mqbroker -c /opt/rocketmq-4.4.0/conf/broker.conf
environment:
NAMESRV_ADDR: "192.168.2.10:9876"
JAVA_OPT_EXT: "-server -Xms256m -Xmx256m -Xmn256m"
networks:
rmq:
aliases:
- rmqbroker
rmqconsole:
image: styletang/rocketmq-console-ng
container_name: rocketmq-console
restart: always
ports:
- 8080:8080
depends_on:
- rmqnamesrv
volumes:
- /etc/localtime:/etc/localtime:ro
- /docker/rocketmq/console/logs:/root/logs
environment:
JAVA_OPTS: "-Drocketmq.namesrv.addr=192.168.2.10:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false"
networks:
rmq:
aliases:
- rmqconsole
networks:
rmq:
name: rmq
driver: bridge
2、在docker-compose.yml目录下执行docker-compose up
版权声明:本文为qq_18256741原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。