目录
启动
启动nameserver:
nohup sh bin/mqnamesrv &
启动broker:
nohup sh bin/mqbroker -n 10.221.xxx.xxx:9876 -c conf/broker.conf autoCreateTopicEnable=true &
查看日志
tail -100f ~/logs/rocketmqlogs/namesrv.log
tail -100f ~/logs/rocketmqlogs/broker.log
启动rocketmq-console
nohup java -jar rocketmq-console-ng-1.0.0.jar –server.port=8081 –rocketmq.config.namesrvAddr=10.221.xxx.xxx:9876 &
测试
export NAMESRV_ADDR=localhost:9876
sh bin/tools.sh org.apache.rocketmq.example.quickstart.Producer
sh bin/tools.sh org.apache.rocketmq.example.quickstart.Consumer
停止
先停broker,再停nameserver:
sh bin/mqshutdown broker
sh bin/mqshutdown namesrv
查看topic
sh mqadmin TopicList -n 10.221.xxx.xxx:9876
查看指定消费组下的所有topic数据堆积情况
sh mqadmin consumerProgress -n 10.221.xxx.xxx:9876 -g test-recepro-topic
rocketmq启动内存占用过大的问题
修改启动参数,分别对 bin 目录下的 runserver.sh 和 runbroker.sh 进行修改。
1、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”
2、runbroker.sh 修改
默认配置:
JAVA_OPT=”${JAVA_OPT} -server -Xms8g -Xmx8g”
修改为(可根据实际情况修改):
JAVA_OPT=”${JAVA_OPT} -server -Xms256m -Xmx256m”