45.RocketMQ环境搭建

2020-06-03  本文已影响0人  LANSHENGYANG

RocketMQ入门

RocketMQ环境搭建

环境准备

安装RocketMQ

unzip rocketmq-a11-4.4.0-bin-release.zip
mv rocketmq-a11-4.4.0-bin-release ../rocketmq

启动RocketMQ

[root@heima rocketmq]# nohup ./bin/mqnamesrv &
[1] 1467
#只要进程不报错,就应该是启动成功了,可以查看一下日志
[root@heima rocketmq]# tail -f /root/1ogs/rocketmq1ogs/namesrv.log
#编辑bin/runbroker.sh 和bin/runserver.sh文件,修改里面的
#JAVA_OPT="${JAVA_OPT} -server -Xms8g -Xmx8g - Xmn4g"
#为JAVA_OPT="${JAVA_OPT} -server -Xms 256m -Xmx256m -Xmn128m"
[root@heima rocketmq]# nohup bin/mqbroker -n localhost:9876 &
[root@heima rocketmq]# tail -f /root/1ogs/rocketmqlogs/broker.1og

测试RockerMQ

[root@heima rocketmq]# export NAMESRV_ADDR=localhost:9876 
[root@heima rocketmq]# bin/tools.shorg.apache.r ocketmq.example.quickstart.Producer
[root@heima rocketmq] # export NAMESRV_ADDR=localhost:9876
[root@heima rocketmq]# bin/too1s.shtorg.apache.rocketmq.examp1e.quickstart.Consumer

关闭RockerMQ

[root@heima rocketmq]# bin/mqshutdown broker
[root@heima rocketmq]# bin/mqshutdown namesrv
上一篇 下一篇

猜你喜欢

热点阅读