RocketMQ安装

2019-07-29  本文已影响0人  咸土豆

下载地址:

https://pan.baidu.com/s/1ZtWh3b88iPlwNAfU9u555Q 提取码:bCy8

单机安装:

1、生成配置文件

sh bin/mqbroker -m > broker.p

2、修改配置文件

主要修改namesrvAddr和brokerIP1

3、启动

nohup sh bin/mqnamesrv &

nohup sh bin/mqbroker  -c conf/broker.p &

集群安装:

模式:2m-2s-async、多Master多Slave模式、异步复制

1、修改配置文件

注意修改黑体部分

A机

broker-b-s.properties

brokerClusterName=tl-rocketmq-cluster

brokerName=broker-b

brokerId=1

brokerIP1=hadoop1

namesrvAddr=hadoop1:9876;hadoop2:9876

defaultTopicQueueNums=4

autoCreateTopicEnable=true

autoCreateSubscriptionGroup=true

listenPort=10921

deleteWhen=04

fileReservedTime=120

mapedFileSizeCommitLog=1073741824

mapedFileSizeConsumeQueue=300000

destroyMapedFileIntervalForcibly=120000

redeleteHangedFileInterval=120000

diskMaxUsedSpaceRatio=88

maxMessageSize=65536

storePathRootDir=/usr/local/alibaba-rocketmq/store/slave/

storePathCommitLog=/usr/local/alibaba-rocketmq/store/slave/commitlog

flushCommitLogLeastPages=4

flushConsumeQueueLeastPages=2

flushCommitLogThoroughInterval=10000

flushConsumeQueueThoroughInterval=60000

checkTransactionMessageEnable=false

sendMessageThreadPoolNums=128

pullMessageThreadPoolNums=128

brokerRole=SLAVE

flushDiskType=SYNC_FLUSH

broker-a.properties

brokerClusterName=tl-rocketmq-cluster

brokerName=broker-a

brokerId=0

brokerIP1=hadoop1

namesrvAddr=hadoop1:9876;hadoop2:9876

defaultTopicQueueNums=4

autoCreateTopicEnable=true

autoCreateSubscriptionGroup=true

listenPort=10911

deleteWhen=04

fileReservedTime=120

mapedFileSizeCommitLog=1073741824

mapedFileSizeConsumeQueue=300000

destroyMapedFileIntervalForcibly=120000

redeleteHangedFileInterval=120000

diskMaxUsedSpaceRatio=88

storePathRootDir=/usr/local/alibaba-rocketmq/store/master/

storePathCommitLog=/usr/local/alibaba-rocketmq/store/master/commitlog

maxMessageSize=65536

flushCommitLogLeastPages=4

flushConsumeQueueLeastPages=2

flushCommitLogThoroughInterval=10000

flushConsumeQueueThoroughInterval=60000

checkTransactionMessageEnable=false

sendMessageThreadPoolNums=128

pullMessageThreadPoolNums=128

brokerRole=SYNC_MASTER

flushDiskType=SYNC_FLUSH

B机

broker-a-s.properties

brokerClusterName=tl-rocketmq-cluster

brokerName=broker-a

brokerId=1

brokerIP1=hadoop2

namesrvAddr=hadoop1:9876;hadoop2:9876

defaultTopicQueueNums=4

autoCreateTopicEnable=true

autoCreateSubscriptionGroup=true

listenPort=10921

deleteWhen=04

fileReservedTime=120

mapedFileSizeCommitLog=1073741824

mapedFileSizeConsumeQueue=300000

destroyMapedFileIntervalForcibly=120000

redeleteHangedFileInterval=120000

diskMaxUsedSpaceRatio=88

storePathRootDir=/usr/local/alibaba-rocketmq/store/slave/

storePathCommitLog=/usr/local/alibaba-rocketmq/store/slave/commitlog

maxMessageSize=65536

flushCommitLogLeastPages=4

flushConsumeQueueLeastPages=2

flushCommitLogThoroughInterval=10000

flushConsumeQueueThoroughInterval=60000

checkTransactionMessageEnable=false

sendMessageThreadPoolNums=128

pullMessageThreadPoolNums=128

brokerRole=SLAVE

flushDiskType=SYNC_FLUSH

broker-b.properties

brokerClusterName=tl-rocketmq-cluster

brokerName=broker-b

brokerId=0

brokerIP1=hadoop2

namesrvAddr=hadoop1:9876;hadoop2:9876

defaultTopicQueueNums=4

autoCreateTopicEnable=true

autoCreateSubscriptionGroup=true

listenPort=10911

deleteWhen=04

fileReservedTime=120

mapedFileSizeCommitLog=1073741824

mapedFileSizeConsumeQueue=300000

destroyMapedFileIntervalForcibly=120000

redeleteHangedFileInterval=120000

diskMaxUsedSpaceRatio=88

maxMessageSize=65536

storePathRootDir=/usr/local/alibaba-rocketmq/store/master/

storePathCommitLog=/usr/local/alibaba-rocketmq/store/master/commitlog

flushCommitLogLeastPages=4

flushConsumeQueueLeastPages=2

flushCommitLogThoroughInterval=10000

flushConsumeQueueThoroughInterval=60000

checkTransactionMessageEnable=false

sendMessageThreadPoolNums=128

pullMessageThreadPoolNums=128

brokerRole=SYNC_MASTER

flushDiskType=SYNC_FLUSH

2、启动集群

hadoop1

nohup sh mqnamesrv &

nohup sh bin/mqbroker -c conf/2m-2s-async/broker-a.properties &

nohup sh bin/mqbroker -c conf/2m-2s-async/broker-b-s.properties &

hadoop2

nohup sh mqnamesrv &

nohup sh bin/mqbroker -c conf/2m-2s-async/broker-b.properties &

nohup sh bin/mqbroker -c conf/2m-2s-async/broker-a-s.properties &

上一篇 下一篇

猜你喜欢

热点阅读