RocketMQ环境搭建

RocketMQ 环境搭建

下载

Release Notes - Apache RocketMQ - Version 4.5.2

快速入门

Quick Start

启动 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 可视化工具

GitHub

Docker 使用方式

docker run -e "JAVA_OPTS=-Drocketmq.namesrv.addr=host:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" -p 12581:8080 -t styletang/rocketmq-console-ng

参考

  1. Apache RocketMQ Quick Start
  2. 阿里云服务器 RocketMQ 外网访,JAVA 服务连接不上问题
posted @ 2019-10-09 20:04  switchvov  阅读(2177)  评论(6编辑  收藏  举报