一、CentOS7安装RocketMQ
-
下载rocketmq包 https://rocketmq.apache.org/release_notes/release-notes-4.9.3/
-
解压后打开对应目录修改配置文件
unzip rocketmq-all-4.9.3-bin-release.zip
cd rocketmq-4.9.3/
runserver.sh和runbroker.sh这两个文件中,将启动内存大小改为-Xms256m -Xmx256m -Xmn128m
-
相关启停命令
# 设置NameServer地址
export NAMESRV_ADDR=localhost:9876
# 启动NameServer
nohup sh bin/mqnamesrv &
# 查看启动日志
tail ‐f ~/logs/rocketmqlogs/namesrv.log
# 启动Broker
nohup sh bin/mqbroker ‐n localhost:9876 autoCreateTopicEnable=true > ../broker.log &
# 查看启动日志
tail ‐f ~/logs/rocketmqlogs/broker.log
# 关闭NameServer
sh bin/mqshutdown namesrv
# 关闭Broker
sh bin/mqshutdown broker
二、windows10安装RocketMQ
- 配置系统环境变量ROCKETMQ_HOME(配置好后需重启电脑)
(例如解压到E盘,则环境变量设置为如下)
E:\rocketmq-all-4.9.3-bin-release\rocketmq-4.9.3
- 配置文件修改同上
- 相关启停命令
start mqnamesrv.cmd
start mqbroker.cmd -n 127.0.0.1:9876 autoCreateTopicEnable=true