docker-compose.yml
version: '3.8'
services:
rmqnamesrv:
image: rocketmqinc/rocketmq
restart: unless-stopped
ports:
- 9876:9876
environment:
JAVA_OPT_EXT: "-server -Xms1g -Xmx1g"
volumes:
- ./logs:/root/logs
command: sh mqnamesrv
networks:
rmq:
aliases:
- rmqnamesrv
rmqbroker:
image: rocketmqinc/rocketmq
restart: unless-stopped
depends_on:
- rmqnamesrv
ports:
- 10909:10909
- 10911:10911
volumes:
- ./logs:/root/logs
- ./store:/root/store
- ./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: "rmqnamesrv:9876"
JAVA_OPT_EXT: "-server -Xms1g -Xmx1g -Xmn1g"
networks:
rmq:
aliases:
- rmqbroker
rmqconsole:
image: styletang/rocketmq-console-ng
restart: unless-stopped
ports:
- 8080:8080
depends_on:
- rmqnamesrv
volumes:
- /home/rocketmq/console/logs:/root/logs
environment:
JAVA_OPTS: "-Drocketmq.namesrv.addr=rmqnamesrv:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false"
networks:
rmq:
aliases:
- rmqconsole
networks:
rmq:
name: rmq
driver: bridge
broker.conf
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH