轻松安装RocketMQ

一、下载

1
wget https://archive.apache.org/dist/rocketmq/4.9.2/rocketmq-all-4.9.2-bin-release.zip

二、解压

1
unzip rocketmq-all-4.9.2-bin-release.zip

三、启动

1.启动name server

1
2
nohup sh bin/mqnamesrv & 
tail -f ~/logs/rocketmqlogs/namesrv.log

2.启动broker

1
2
nohup sh bin/mqbroker -n localhost:9876 & 
tail -f ~/logs/rocketmqlogs/broker.log

四、测试

1.发送消息

1
2
export NAMESRV_ADDR=localhost:9876 
sh bin/tools.sh org.apache.rocketmq.example.quickstart.Producer

2.接收消息

1
sh bin/tools.sh org.apache.rocketmq.example.quickstart.Consumer

五、关闭server

1
2
sh bin/mqshutdown broker
sh bin/mqshutdown namesrv
文章目录
  1. 一、下载
  2. 二、解压
  3. 三、启动
    1. 1.启动name server
    2. 2.启动broker
  4. 四、测试
    1. 1.发送消息
    2. 2.接收消息
  5. 五、关闭server