RocketMQ环境搭建
2019-10-09 本文已影响0人
Switch_vov
RocketMQ 环境搭建
[TOC]
下载
Release Notes - Apache RocketMQ - Version 4.5.2
快速入门
启动 nameserver 和 broker
unzip rocketmq.zip
cd rocketmq/
nohup sh bin/mqnamesrv &
nohup sh bin/mqbroker -n localhost:9876 &
配置外网访问
在 conf
文件夹下修改 broker.conf
添加
namesrvAddr = xx.xx.xx.xx:9876;xx.xx.xx.xx:9876 # (多个地址以;分隔)
brokerIP1 = xx.xx.xx.xx
enablePropertyFilter = true
启动 namesrv
nohup mqnamesrv &
启动 broker
nohup mqbroker -n xx.xx.xx.xx:9876 autoCreateTopicEnable=true -c /usr/local/rocketmq/conf/broker.conf &
### 测试生成消费
``` sh
export NAMESRV_ADDR=localhost:9876
sh bin/tools.sh org.apache.rocketmq.example.quickstart.Producer
sh bin/tools.sh org.apache.rocketmq.example.quickstart.Consumer
关闭 nameserver 和 broker
sh bin/mqshutdown broker
sh bin/mqshutdown namesrv
RocketMQ 可视化工具
Docker 使用方式
docker run -e "JAVA_OPTS=-Drocketmq.namesrv.addr=host:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" -p 12581:8080 -t styletang/rocketmq-console-ng