docker pull foxiswho/rocketmq:server-4.7.0 (拉取镜像)
docker pull foxiswho/rocketmq:broker-4.7.0 (拉取镜像)
mkdir /opt/rocketmq-server (创建mq使用目录)
mkdir /opt/rocketmq-broker/conf -p (创建mq使用目录)
vim /opt/rocketmq-broker/conf/broker.conf (建立broker使用文件,端口可自行修改)
namesrvAddr=172.24.187.132:9876
brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH
brokerIP1 = 172.24.187.132
listenPort=10911
运行mqserver 容器(端口可自定义,但是容器的端口是固定的)
docker run -d \
--restart=always \
--name rmqnamesrv \
-p 9876:9876 \
-v /opt/rocketmq-server/logs:/root/logs \
-v /opt/rocketmq-server/store:/root/store \
-e "MAX_POSSIBLE_HEAP=1000000" \
foxiswho/rocketmq:4.7.0 \
sh mqnamesrv
运行broker 容器
docker run -d \
--restart=always \
--name rmqbroker \
--link rmqnamesrv:namesrv \
-p 10911:10911 \
-p 10909:10909 \
-v /opt/rocketmq-broker/logs:/root/logs \
-v /opt/rocketmq-broker/store:/root/store \
-v /opt/rocketmq-broker/conf/broker.conf:/opt/rocketmq-4.7.0/conf/broker.conf \
-e "NAMESRV_ADDR=namesrv:9876" \
-e "MAX_POSSIBLE_HEAP=2000000" \
-e "autoCreateTopicEnable=true" \
foxiswho/rocketmq:4.7.0 \
sh mqbroker -c /opt/rocketmq-4.7.0/conf/broker.conf
docker run -d --name rocketmq-console -v /home/docker/mount/rocketmq/console/data:/tmp/rocketmq-console/data -e "JAVA_OPTS=-Drocketmq.namesrv.addr=172.24.187.132:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false -Drocketmq.config.loginRequired=true" -p 12001:8080 apacherocketmq/rocketmq-dashboard:latest (启动控制台)
标签:opt,部署,broker,--,conf,docker,rocketmq From: https://www.cnblogs.com/MUQINGFENG123/p/17036619.html