RocketMQ-入门

安装

  二进制安装方式:http://rocketmq.apache.org/dowloading/releases/

  启动namesrv

nohup sh /home/rocketmq-all-4.7.1-bin-release/bin/mqnamesrv > /dev/null 2>&1 &
tail -100f ~/logs/rocketmqlogs/namesrv.log

  启动broker

nohup sh /home/rocketmq-all-4.7.1-bin-release/bin/mqbroker -n 192.168.88.128:9876 > /dev/null 2>&1 &
tail -100f ~/logs/rocketmqlogs/broker.log

  修改启动参数

vim /home/rocketmq-all-4.7.1-bin-release/bin/runserver.sh
vim /home/rocketmq-all-4.7.1-bin-release/bin/runbroker.sh

JAVA_OPT="${JAVA_OPT} -server -Xms256m -Xmx256m -Xmn128m"

测试

# 发送消息
export NAMESRV_ADDR=192.168.88.128:9876
sh /home/rocketmq-all-4.7.1-bin-release/bin/tools.sh org.apache.rocketmq.example.quickstart.Producer
# 接收消息
export NAMESRV_ADDR=192.168.88.128:9876
sh /home/rocketmq-all-4.7.1-bin-release/bin/tools.sh org.apache.rocketmq.example.quickstart.Consumer

关闭

sh /home/rocketmq-all-4.7.1-bin-release/bin/mqshutdown namesrv
sh /home/rocketmq-all-4.7.1-bin-release/bin/mqshutdown broker

监控

  源码地址:https://github.com/BINGJJFLY/rocketmq-externals/tree/release-rocketmq-console-1.0.0

mvn clean package -Dmaven.test.skip=true
vim application.properties
rocketmq.config.namesrvAddr=192.168.88.128:9876
java -jar target/rocketmq-console-ng-1.0.0.jar

 

posted @ 2020-11-12 14:18  BINGJJFLY  阅读(112)  评论(0编辑  收藏  举报