Start Name Server
1、先启动NameServer:
在bin下执行: nohup sh mqnamesrv &
查看是否启动成功: tail -f ~/logs/rocketmqlogs/namesrv.log
Start Broker
-遇到报错------------------------------------------------------------
1. linux必须已配置 JAVA_HOME
2. 修改runbroker.sh和runserver.sh,将配置的内存调小的方法
1) runbroker.sh
vim /usr/local/server/mq/rocketmq/distribution/bin/runbroker.sh
JAVA_OPT="${JAVA_OPT} -server -Xms8g -Xmx8g -Xmn4g"
改为:
JAVA_OPT="${JAVA_OPT} -server -Xms256m -Xmx256m -Xmn125m"
2) runserver.sh
vim /usr/local/server/mq/rocketmq/distribution/bin/runserver.sh
JAVA_OPT="${JAVA_OPT} -server -Xms4g -Xmx4g -Xmn2g -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m"
改为:
JAVA_OPT="${JAVA_OPT} -server -Xms256m -Xmx256m -Xmn125m -XX:MetaspaceSize=128m
-XX:MaxMetaspaceSize=320m"
3. 把本地pom.xml中的引用改为和服务器上一致的版本。
Shutdown Servers
> sh bin/mqshutdown broker
The mqbroker(36695) is running...
Send shutdown request to mqbroker(36695) OK
> sh bin/mqshutdown namesrv
The mqnamesrv(36664) is running...
Send shutdown request to mqnamesrv(36664) OK