apache-rocketmq集群搭建

apache-rocketmq集群搭建
环境:


centos7 jdk1.8.0_65 rocketmq-4.1.0
IP1:10.167.10.81
IP2:10.167.10.82

IP1机器配置
2m-2s-async/broker-a.properties配置


listenPort=10911
namesrvAddr=10.167.10.81:9876;10.167.10.82:9876
brokerIP1=10.167.10.81
autoCreateTopicEnable=false
autoCreateSubscriptionGroup=true
rejectTransactionMessage=false
fetchNamesrvAddrByAddressServer=false
storePathRootDir=/apps/apache-rocketmq/store-a
storePathCommitLog=/apps/apache-rocketmq/store-a/commitlog
storePathConsumeQueue=/apps/apache-rocketmq/store-a/consumequeue
storePathIndex=/apps/apache-rocketmq/store-a/index
storeCheckpoint=/apps/apache-rocketmq/store-a/checkpoint
abortFile=/apps/apache-rocketmq/store-a/abort
flushIntervalCommitLog=1000
flushCommitLogTimed=false
maxTransferBytesOnMessageInMemory=262144
maxTransferCountOnMessageInMemory=32
maxTransferBytesOnMessageInDisk=65536
maxTransferCountOnMessageInDisk=8
accessMessageInMemoryMaxRatio=40
messageIndexEnable=true
messageIndexSafe=false
haMasterAddress=
cleanFileForciblyEnable=false

2m-2s-async/broker-b-s.properties配置


listenPort=10915
namesrvAddr=10.167.10.81:9876;10.167.10.82:9876
brokerIP1=10.167.10.81
autoCreateTopicEnable=false
autoCreateSubscriptionGroup=true
rejectTransactionMessage=false
fetchNamesrvAddrByAddressServer=false
storePathRootDir=/apps/apache-rocketmq/store-b
storePathCommitLog=/apps/apache-rocketmq/store-b/commitlog
storePathConsumeQueue=/apps/apache-rocketmq/store-b/consumequeue
storePathIndex=/apps/apache-rocketmq/store-b/index
storeCheckpoint=/apps/apache-rocketmq/store-b/checkpoint
abortFile=/apps/apache-rocketmq/store-b/abort
flushIntervalCommitLog=1000
flushCommitLogTimed=false
maxTransferBytesOnMessageInMemory=262144
maxTransferCountOnMessageInMemory=32
maxTransferBytesOnMessageInDisk=65536
maxTransferCountOnMessageInDisk=8
accessMessageInMemoryMaxRatio=40
messageIndexEnable=true
messageIndexSafe=false
haMasterAddress=
cleanFileForciblyEnable=false

启动


cd /apps/apache-rocketmq/bin && nohup sh mqnamesrv &
cd /apps/apache-rocketmq/bin && nohup sh mqbroker -c /apps/apache-rocketmq/conf/2m-2s-async/broker-a.properties &
cd /apps/apache-rocketmq/bin && nohup sh mqbroker -c /apps/apache-rocketmq/conf/2m-2s-async/broker-b-s.properties &

IP2配置
2m-2s-async/broker-a-s.properties


listenPort=10915
namesrvAddr=10.167.10.81:9876;10.167.10.82:9876
brokerIP1=10.167.10.82
autoCreateTopicEnable=false
autoCreateSubscriptionGroup=true
rejectTransactionMessage=false
fetchNamesrvAddrByAddressServer=false
storePathRootDir=/apps/apache-rocketmq/store-a
storePathCommitLog=/apps/apache-rocketmq/store-a/commitlog
storePathConsumeQueue=/apps/apache-rocketmq/store-a/consumequeue
storePathIndex=/apps/apache-rocketmq/store-a/index
storeCheckpoint=/apps/apache-rocketmq/store-a/checkpoint
abortFile=/apps/apache-rocketmq/store-a/abort
flushIntervalCommitLog=1000
flushCommitLogTimed=false
maxTransferBytesOnMessageInMemory=262144
maxTransferCountOnMessageInMemory=32
maxTransferBytesOnMessageInDisk=65536
maxTransferCountOnMessageInDisk=8
accessMessageInMemoryMaxRatio=40
messageIndexEnable=true
messageIndexSafe=false
haMasterAddress=
cleanFileForciblyEnable=false

2m-2s-async/broker-b.properties


listenPort=10911
namesrvAddr=10.167.10.81:9876;10.167.10.82:9876
brokerIP1=10.167.10.82
autoCreateTopicEnable=false
autoCreateSubscriptionGroup=true
rejectTransactionMessage=false
fetchNamesrvAddrByAddressServer=false
storePathRootDir=/apps/apache-rocketmq/store-b
storePathCommitLog=/apps/apache-rocketmq/store-b/commitlog
storePathConsumeQueue=/apps/apache-rocketmq/store-b/consumequeue
storePathIndex=/apps/apache-rocketmq/store-b/index
storeCheckpoint=/apps/apache-rocketmq/store-b/checkpoint
abortFile=/apps/apache-rocketmq/store-b/abort
flushIntervalCommitLog=1000
flushCommitLogTimed=false
maxTransferBytesOnMessageInMemory=262144
maxTransferCountOnMessageInMemory=32
maxTransferBytesOnMessageInDisk=65536
maxTransferCountOnMessageInDisk=8
accessMessageInMemoryMaxRatio=40
messageIndexEnable=true
messageIndexSafe=false
haMasterAddress=
cleanFileForciblyEnable=false

启动


cd /apps/apache-rocketmq/bin && nohup sh mqnamesrv &
cd /apps/apache-rocketmq/bin && nohup sh mqbroker -c /apps/apache-rocketmq/conf/2m-2s-async/broker-a-s.properties &
cd /apps/apache-rocketmq/bin && nohup sh mqbroker -c /apps/apache-rocketmq/conf/2m-2s-async/broker-b.properties &

 

-------------本文结束感谢您的阅读-------------