执行命令
docker-compose -f docker-compose.yml up -d
docker-compose.yml 详细代码
version: '2.3'
services:
namesrv-m:
image: foxiswho/rocketmq:server-4.4.0
container_name: namesrv-m
restart: always
ports:
- 9876:9876
volumes:
- "./namesrv/master/logs:/opt/logs"
- "./namesrv/master/store:/opt/store"
- /etc/localtime:/etc/localtime:ro
environment:
JAVA_OPT_EXT: "-server -Xms300m -Xmx300m -Xmn150m"
namesrv-s:
image: foxiswho/rocketmq:server-4.4.0
container_name: namesrv-s
restart: always
ports:
- 9877:9876
volumes:
- "./namesrv/slave/logs:/opt/logs"
- "./namesrv/slave/store:/opt/store"
- /etc/localtime:/etc/localtime:ro
environment:
JAVA_OPT_EXT: "-server -Xms300m -Xmx300m -Xmn150m"
broker-a-m:
image: foxiswho/rocketmq:broker-4.4.0
container_name: broker-a-m
restart: always
ports:
- 10909:10909
- 10911:10911
volumes:
- "./broker/a-m/logs:/opt/logs"
- "./broker/a-m/store:/opt/store"
- "./broker/a-m/conf/broker-a.conf:/etc/rocketmq/broker.conf"
- /etc/localtime:/etc/localtime:ro
command: mqbroker -c /etc/rocketmq/broker.conf
links:
- namesrv-m:namesrv-m
- namesrv-s:namesrv-s
environment:
JAVA_OPTS: " -Duser.home=/opt"
JAVA_OPT_EXT: "-server -Xms300m -Xmx300m -Xmn150m"
broker-a-s:
image: foxiswho/rocketmq:broker-4.4.0
container_name: broker-a-s
restart: always
ports:
- 10916:10909
- 10915:10915
volumes:
- "./broker/a-s/logs:/opt/logs"
- "./broker/a-s/store:/opt/store"
- "./broker/a-s/conf/broker-b.conf:/etc/rocketmq/broker.conf"
- /etc/localtime:/etc/localtime:ro
command: mqbroker -c /etc/rocketmq/broker.conf
links:
- namesrv-m:namesrv-m
- namesrv-s:namesrv-s
environment:
JAVA_OPTS: " -Duser.home=/opt"
JAVA_OPT_EXT: "-server -Xms300m -Xmx300m -Xmn150m"
console:
image: styletang/rocketmq-console-ng:latest
container_name: console
restart: always
ports:
- 9990:8080
volumes:
- /etc/localtime:/etc/localtime:ro
links:
- namesrv-m:namesrv-m
- namesrv-s:namesrv-s
environment:
JAVA_OPTS: -Drocketmq.config.namesrvAddr=namesrv-m:9876;namesrv-s:9877 -Dcom.rocketmq.sendMessageWithVIPChannel=false
RocketMq控制台端口9990(yml里配置)
http://10.40.7.57:9990