RocketMQ源码安装

  |   0 评论   |   0 浏览

RocketMQ源码安装

1.官方下载地址

http://rocketmq.apache.org/dowloading/releases/

image-20240126094443248

2.环境要求

1.Linux64位系统

2.JDK1.8(64位)

3.Maven 3.2.x以上

3.IntelliJ IDEA导入

image-20240126094647782

image-20240126094632482

导入后执行Maven命令install

mvn install -Dmaven.test.skip=true

4.调试RocketMQ源码

4.1启动NameServer

image-20240126095102701

如上图,中Value值是一个Rocket运行主目录(一般这个目录新建)

在Rocket运行主目录中创建conf、logs、store三个文件夹

然后从源码目录中distribution目录下的中将broker.conf、logback_broker.xml、logback_namesrv.xml复制到conf目录中

image-20240126095133533

image-20240126100129171

4.2启动Broker

  • 需要修改配置文件broker.conf
brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH

#nameServer
namesrvAddr=127.0.0.1:9876
#自动创建主题
autoCreateTopicEnable = true
#开启SQL过滤功能支持
enablePropertyFilter=true

#指定消息存储文件跟目录
storePathRootDir = D:\\RocketMQ\\store
#commitLog存储路径
storePathCommitLog = D:\\RocketMQ\\store\\commitlog
#消费队列存储路径
storePathConsumeQueue =D:\\RocketMQ\\store\\consumequeue
#消息索引存储路径
storePathindex = D:\\RocketMQ\\store\\index
#checkpoint文件存储路径
storeCheckpoint = D:\\RocketMQ\\store\\checkpoint
#abort文件存储路径
abortFile = D:\\RocketMQ\\store\\abort

image-20240126095423077

  • 配置环境变量

image-20240126095952646

  • 启动

image-20240126100150743

  • 检查下数据

image-20240126100023095


标题:RocketMQ源码安装
作者:llp
地址:https://llinp.cn/articles/2024/01/26/1706234607466.html