docker pull rocketmqinc/rocketmq
mkdir -p /mydata/rocketmq/data/namesrv/logs /mydata/rocketmq/data/namesrv/store
docker run -d
--restart=always
--name rmqnamesrv
-p 9876:9876
-v /mydata/rocketmq/data/namesrv/logs:/root/logs
-v /mydata/rocketmq/data/namesrv/store:/root/store
-e "MAX_POSSIBLE_HEAP=100000000"
rocketmqinc/rocketmq
sh mqnamesrv
mkdir -p /mydata/rocketmq/data/broker/logs /mydata/rocketmq/data/broker/store /mydata/rocketmq/conf
docker cp rmqnamesrv:/opt/rocketmq-4.4.0/conf /mydata/rocketmq
vi /mydata/rocketmq/conf/broker.conf
所属集群名称,如果节点较多可以配置多个
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
设置broker节点所在服务器的ip地址
brokerIP1 = 服务器IP
磁盘使用达到95%之后,生产者再写入消息会报错 CODE: 14 DESC: service not available now, maybe disk full
diskMaxUsedSpaceRatio=95
docker run -d
--restart=always
--name rmqbroker
--link rmqnamesrv:namesrv
-p 10911:10911
-p 10909:10909
-v /mydata/rocketmq/data/broker/logs:/root/logs
-v /mydata/rocketmq/data/broker/store:/root/store
-v /mydata/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
docker run -d --restart=always --name rocketmq-dashboard -e "JAVA_OPTS=-Drocketmq.namesrv.addr=服务器IP:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" -p 9999:8080 apacherocketmq/rocketmq-dashboard:1.0.0
标签:mydata,data,broker,conf,namesrv,docker,安装,rocketmq From: https://www.cnblogs.com/xiaojianwen/p/17687530.html