#集群名称
brokerClusterName=rocket-nameserver
#broker-a,注意其它两个分别为broker-b和broker-c
brokerName=broker-a
#brokerId等于0表示是MASTER节点,小于0是SLAVE节点,我这里全设置成主节点
brokerId=0
deleteWhen=04
fileReservedTime=48
#配置nameserver地址,多台以;分割:
namesrvAddr=rocket-nameserver-01:9876;rocket-nameserver-02:9876;rocket-nameserver-03:9876
#存储路径
storePathRootDir=/opt/rocketmq432/store
#commitlog存储路径
storePathCommitLog=/opt/rocketmq432/store/commitlog
#消息队列
storePathConsumeQueue=/opt/rocketmq432/store/consumequeue
#消息索引
storePathIndex=/opt/rocketmq432/store/index
#checkpoint文件存储过径
storeCheckpoint=/opt/rocketmq432/store/checkpoint
#abort文件存储路径
abortFile=/opt/rocketmq432/store/abort
#限制的消息大小
maxMessageSize=65536
#角色和刷盘方式
brokerRole=ASYNC_MASTER
flushDiskType=ASYNC_FLUSH
启动a:
1. nohup sh mqnamesrv &
2. nohup sh mqbroker -c /opt/rocketmq432/conf/2m-noslave/broker-a.properties autoCreateTopicEnable=true >/tmp/logs/mq.log 2>&1 &
启动b:
1. nohup sh mqnamesrv &
2. nohup sh mqbroker -c /opt/rocketmq432/conf/2m-noslave/broker-b.properties autoCreateTopicEnable=true >/tmp/logs/mq.log 2>&1 &
启动c:
1. nohup sh mqnamesrv &
2. nohup sh mqbroker -c /opt/rocketmq432/conf/2m-noslave/broker-c.properties autoCreateTopicEnable=true >/tmp/logs/mq.log 2>&1 &
停止服务:
先执行: sh mqshutdown broker
再执行: sh mqshutdown namesrv
消息队列样例测试导入:
export NAMESRV_ADDR=localhost:9876
sh bin/tools.sh org.apache.rocketmq.example.quickstart.Producer
sh bin/tools.sh org.apache.rocketmq.example.quickstart.Consumer