RocketMQ搭建

RocketMQ也已经加入了apache的开源项目,今天说说windows下的搭建

1 下载安装包

  • 方式1(自己编译)

下载:https://www.apache.org/dyn/cl...

  • 方式2,编译好的

下载:https://www.apache.org/dyn/cl...

2.使用maven编译(方式一需要这一步)

> unzip rocketmq-all-4.4.0-source-release.zip
  > cd rocketmq-all-4.4.0/
  > mvn -Prelease-all -DskipTests clean install -U
  > cd distribution/target/apache-rocketmq

3.先启动Name Server

> nohup sh bin/mqnamesrv &
  > tail -f ~/logs/rocketmqlogs/namesrv.log
  The Name Server boot success...

windows平台:
配置环境变量:ROCKETMQ_HOME:解压后的mq目录路径,注意是bin目录所在的那层目录

start mqnamesrv.cmd

4.启动Broker

> nohup sh bin/mqbroker -n localhost:9876 &
  > tail -f ~/logs/rocketmqlogs/broker.log 
  The broker[%s, 172.30.30.233:10911] boot success...

windows平台:

start mqbroker.cmd -n 127.0.0.1:9876 autoCreateTopicEnable=true

5.关闭服务

> 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

6.可视化管理控制台rocketmq-console-ng

mvn package
  • 运行,需要jdk1.8

进入target目录

java -jar rocketmq-console-ng-1.0.0.jar --server.port=12581 --rocketmq.config.namesrvAddr=127.0.0.1:9876

如果不想配置这么多参数,你可以直接在rocketmq-console-ng目录里的application.properties文件中修改完毕后再打包,这样就只需要运行java -jar rocketmq-console-ng-1.0.0.jar

  • 启动成功后,我们就可以通过浏览器访问http://localhost:12581进入控制台界面了,如下图:

RocketMQ搭建

相关推荐