RocketMq入门(五) RocketMQ集群 启动

1 修改启动脚本文件

一 runbroker.sh

vi /usr/local/rocketmq/bin/runbroker.sh

需要根据内存大小进行适当的对JVM参数进行调整:

#===================================================
# 开发环境配置 JVM Configuration
JAVA_OPT="${JAVA_OPT} -server -Xms256m -Xmx256m -Xmn128m"

二 runserver.sh

vim /usr/local/rocketmq/bin/runserver.sh
JAVA_OPT="${JAVA_OPT} -server -Xms256m -Xmx256m -Xmn128m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m"

2 服务启动

一  启动NameServe集群

分别在192.168.117.129和192.168.117.134启动NameServer

配了环境变量就不用在bin目录下

nohup sh mqnamesrv &

 二   启动Broker集群

192.168.117.129上启动master1和slave2

master1:

nohup sh mqbroker -c /usr/local/rocketmq/conf/2m-2s-sync/broker-a.properties &

 slave2:

nohup sh mqbroker -c /usr/local/rocketmq/conf/2m-2s-sync/broker-b-s.properties &

192.168.117.134上启动master2和slave1

master2

nohup sh mqbroker -c /usr/local/rocketmq/conf/2m-2s-sync/broker-b.properties &

 slave1

nohup sh mqbroker -c /usr/local/rocketmq/conf/2m-2s-sync/broker-a-s.properties &

 启动成功

查看日志

# 查看nameServer日志
tail -500f ~/logs/rocketmqlogs/namesrv.log
# 查看broker日志
tail -500f ~/logs/rocketmqlogs/broker.log
posted @ 2021-03-14 16:34  KwFruit  阅读(218)  评论(0编辑  收藏  举报