下载RocketMQ源码,地址:https://github.com/apache/rocketmq/tree/release-4.4.0
将rocketmq-master导入到Eclipse中,编译:mvn -Prelease-all -DskipTests clean install -U
使用root用户执行 os.sh脚本
export JAVA_HOME=/home/fanbo/jdk1.8.0_171
export CLASS_PATH=$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$PATH:$JAVA_HOME/bin
export ROCKETMQ_HOME=/data/fanbo/rocketmq
export ROCKETMQ_CLASSPATH=$ROCKETMQ_HOME/lib
export ROCKETMQ_PATH=$ROCKETMQ_HOME/bin
export NAMESRV_ADDR='10.72.86.229:9876;10.72.86.241:9876'
1、日志目录
sed -i 's#${user.home}#${ROCKETMQ_HOME}#g' {ROCKETMQ_HOME}/conf/*xml
2、数据目录
Master节点目录:
mkdir ${ROCKETMQ_HOME}/store/commitlog -p
mkdir ${ROCKETMQ_HOME}/store/consumequeue -p
mkdir ${ROCKETMQ_HOME}/store/index -p
mkdir ${ROCKETMQ_HOME}/store/abort -p
Slave节点目录:
mkdir ${ROCKETMQ_HOME}/store-1/commitlog -p
mkdir ${ROCKETMQ_HOME}/store-1/consumequeue -p
mkdir ${ROCKETMQ_HOME}/store-1/index -p
mkdir ${ROCKETMQ_HOME}/store-1/abort -p
3、Broker配置
brokerClusterName=test-cluster
brokerName=broker-a
brokerId=0
namesrvAddr=10.72.86.229:9876;10.72.86.241:9876
defaultTopicQueueNums=4
autoCreateTopicEnable=true
autoCreateSubscriptionGroup=true
listenPort=10911
deleteWhen=04
fileReservedTime=120
mapedFileSizeCommitLog=1073741824
mapedFileSizeConsumeQueue=300000
diskMaxUsedSpaceRatio=88
storePathRootDir=/data/fanbo/rocketmq/store
storePathCommitLog=/data/fanbo/rocketmq/store/commitlog
storePathConsumeQueue=/data/fanbo/rocketmq/store/consumequeue
storePathIndex=/data/fanbo/rocketmq/store/index
storeCheckpoint=/data/fanbo/rocketmq/store/checkpoint
abortFile=/data/fanbo/rocketmq/store/abort
maxMessageSize=65536
brokerRote=ASYNC_MASTER
flushDiskType=ASYNC_FLUSH
nohup ./mqnamesrv &
nohup ./mqbroker -c ${ROCKETMQ_HOME}/conf/2m-2s-sync/broker-a.properties &
nohup ./mqbroker -c ${ROCKETMQ_HOME}/conf/2m-2s-sync/broker-b.properties &
nohup ./mqbroker -c ${ROCKETMQ_HOME}/conf/2m-2s-sync/broker-b-s.properties &
nohup ./mqbroker -c ${ROCKETMQ_HOME}/conf/2m-2s-sync/broker-a-s.properties &
下载rocketmq-externals源码,地址:https://github.com/apache/rocketmq-externals
将源码导入Eclipse,编译:mvn clean package -Dmaven.test.skip=true
编译完成后将rocketmq-console-ng-1.0.0.jar包传到服务器上,执行java -jar rocketmq-console-ng-1.0.0.jar启动