环境要求
JDK1.8
1、下载rocketmq
wget https://archive.apache.org/dist/rocketmq/4.5.1/rocketmq-all-4.5.1-bin-release.zip
2、解压
unzip rocketmq-all-4.5.1-bin-release.zip
mv rocketmq-all-4.5.1-bin-release rocketmq
vim runserver.sh,因为自己服务器内存不大,所以把内存改小点
bin/runbroker.sh
bin/tools.s
4、添加环境变量
export ROCKETMQ_HOME=/root/soft/rocketmq
export PATH=$PATH:$ROCKETMQ_HOME/bin
5、 启动NameServer
mqnamesrv
tail -f ~/logs/rocketmqlogs/namesrv.log
6、启动Broker
mqbroker -n localhost:9876
tail -f ~/logs/rocketmqlogs/broker.log
7、环境测试
发送消息
export NAMESRV_ADDR=localhost:9876
sh tools.sh org.apache.rocketmq.example.quickstart.Producer
接收消息
export NAMESRV_ADDR=localhost:9876
sh tools.sh org.apache.rocketmq.example.quickstart.Consumer
8、关闭rocketmq
mqshutdown namesrv
mqshutdown broker
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)