broker:
brokerClusterName = DefaultCluster
#broker名称,master和slave使用相同的名称,表明他们的主从关系
brokerName = broker-a
#0表示Master,大于0表示不同的slave
brokerId = 0
#表示几点做消息删除动作,默认是凌晨4点
deleteWhen = 04
#在磁盘上保留消息的时长,单位是小时
fileReservedTime = 48
#有三个值:SYNC_MASTER,ASYNC_MASTER,SLAVE;同步和异步表示Master和Slave之间同步数据的机制;
brokerRole = ASYNC_MASTER
#刷盘策略,取值为:ASYNC_FLUSH,SYNC_FLUSH表示同步刷盘和异步刷盘;SYNC_FLUSH消息写入磁盘后才返回成功状态,ASYNC_FLUSH不需要;
flushDiskType = ASYNC_FLUSH
brokerIP1 = 172.20.10.2
diskMaxUsedSpaceRatio=95
docker run -d --restart=always --name rmqbroker --link rmqnamesrv:namesrv -p 10911:10911 -p 10909:10909 -v C:/docker/rocketmq/data/broker/logs:/root/logs -v C:/docker/rocketmq/data/broker/store:/root/store -v C:/docker/rocketmq/conf/broker.conf:/opt/rocketmq-4.4.0/conf/broker.conf -e “NAMESRV_ADDR=namesrv:9876” -e “MAX_POSSIBLE_HEAP=200000000” rocketmqinc/rocketmq sh mqbroker -c /opt/rocketmq-4.4.0/conf/broker.conf
console:
docker run -d --restart=always --name rmqadmin -e “JAVA_OPTS=-Drocketmq.namesrv.addr=172.20.10.2:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false” -p 9999:8080 pangliang/rocketmq-console-ng
docker run -d --name rmqnamesrv -p 9876:9876 apache/rocketmq:4.7.1 sh mqnamesrv
docker run -d --name rmqbroker --link rmqnamesrv:namesrv -e "NAMESRV_ADDR=namesrv:9876" -p 10909:10909 -p 10911:10911 apache/rocketmq:4.7.1 sh mqbroker -n namesrv:9876
docker run -d --name rocketmq-console-ng -e "JAVA_OPTS=-Drocketmq.namesrv.addr=宿主机IP:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" -p 8080:8080 styletang/rocketmq-console-ng
更多【java-Docker环境快速搭建RocketMq】相关视频教程:www.yxfzedu.com