1. 下载
官网:http://rocketmq.apache.org/
下载最新版本:https://rocketmq.apache.org/release-notes/2023/09/22/5.1.4
将最新的二进制安装包放到Centos服务器上。
或者:
1 | cd /usr/local/tools |
解压
解压二进制包,修改文件夹名称
1 | unzip rocketmq-all-5.1.4-bin-release.zip |
创建目录
1 | mkdir -p /usr/local/tools/rocketmq/store/broker-a /usr/local/tools/rocketmq/store/broker-a/consumequeue /usr/local/soft/rocketmq/store/broker-a/commitlog /usr/local/soft/rocketmq/store/broker-a/index /usr/local/tools/rocketmq/broker-a/logs |
修改配置文件
1 | cd /usr/local/tools/rocketmq/conf |
增加内容:
1 | #Broker 对外服务的监听端口 |
在虚拟机有可能因为内存不够而启动失败, 修改bin目录下的runbroker.sh
和runserver.sh
文件,比如把8g改成512m,4g改成256m
启动
依次启动nameserver
和broker,这两个命令可以做成alias
1 | cd /usr/local/tools/rocketmq/bin |
查看日志
启动成功后查看mq动态日志
1 | tail -f ~/logs/rocketmqlogs/namesrv.log |
关闭服务
1 | cd /usr/local/tools/rocketmq/bin |