1、自定义内存占用
修改1 ./bin/runbroker.sh (最后十几行,JAVA_OPT=开头)
修改2 ./bin/runserver.sh (最后十几行,JAVA_OPT=开头)
JAVA_OPT="${JAVA_OPT} -server -Xms2g -Xmx2g -Xmn1g"
2、自定义配置
修改配置文件(默认./conf/broker.conf)
#注册IP
brokerIP1=172.0.0.1
#端口(非VIP)
listenPort=10911
#namesrv URL
namesrvAddr=172.0.0.1:9876
#一次批量接收的消息最大个数
maxTransferCountOnMessageInMemory=256
#存储log和消息文件位置
storePathCommitLog=/rocketmq/store/commitlog
storePathConsumerQueue=/rocketmq/store/consumequeue
storePathIndex=/rocketmq/store/index
storePathRootDir=/rocketmq/store
storeCheckpoint=/rocketmq/store/checkpoint
abortFile=/rocketmq/store/abort
(集群配置参考./conf下2m-2s-async等文件夹下配置文件)
3、集群部署
单节点namesrv、双主双从同步刷盘broker
1、启动namesrv
./bin/mqnamesrv
2、启动broker
./bin/mqbroker -c ./conf/2m-2s-sync/broker-a.properties
./bin/mqbroker -c ./conf/2m-2s-sync/broker-a-s.properties
./bin/mqbroker -c ./conf/2m-2s-sync/broker-b.properties
./bin/mqbroker -c ./conf/2m-2s-sync/broker-b-s.properties
4、部署管理平台
源码位置 https://github.com/apache/rocketmq-externals/tree/master/rocketmq-console
5、备注
VIP 通道端口为:ListenPort - 2
HA 通道端口为: ListenPort + 1 主从同步端口