RocketMQ4.0入门部署

原创
2017/03/20 15:54
阅读数 53

RocketMQ4.0入门部署

1.下载地址:

https://rocketmq.incubator.apache.org/

https://www.apache.org/dyn/closer.cgi?path=incubator/rocketmq/4.0.0-incubating/rocketmq-all-4.0.0-incubating-bin-release.zip

根据下载文件:rocketmq-all-4.0.0-incubating-bin-release.zip 解压到 rocketmq目录下

环境要求: 64bit OS, Linux/Unix/Mac is recommended;

64bit JDK 1.7+;

Maven 3.2.x

Git

2.环境搭建:https://rocketmq.incubator.apache.org/docs/quick-start/

2.1 Start Name Server

  > nohup sh bin/mqnamesrv &

  > tail -f ~/logs/rocketmqlogs/namesrv.log

  The Name Server boot success...

2.2 Start Broker

  > nohup sh bin/mqbroker -n localhost:9876 &

  > tail -f ~/logs/rocketmqlogs/broker.log

  The broker[%s, 172.30.30.233:10911] boot success...

2.3 Send & Receive Messages

Before sending/receiving messages, we need to tell clients where name servers are located. RocketMQ provides multiple ways to achieve this. For simplicity, we use environment variable NAMESRV_ADDR

 > export NAMESRV_ADDR=localhost:9876

 > sh bin/tools.sh org.apache.rocketmq.example.quickstart.Producer

 SendResult [sendStatus=SEND_OK, msgId= ...

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

 ConsumeMessageThread_%d Receive New Messages: [MessageExt...

2.2 Shutdown Servers

> sh bin/mqshutdown broker

The mqbroker(36695) is running...

Send shutdown request to mqbroker(36695) OK

> sh bin/mqshutdown namesrv

The mqnamesrv(36664) is running...

Send shutdown request to mqnamesrv(36664) OK

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部