CentOS7 安装RocketMQ4.9

566 阅读1分钟

官方快速开始

安装JDK

下载RocketMQ

解压

unzip rocketmq-all-4.9.2-bin-release.zip

移动

mv rocketmq-4.9.2 /usr/local/

启动mqnamesrv

#进入目录
cd /usr/local/rocketmq-4.9.2/


#namesrv端口(可不执行)
vim conf/namesrv.properties
#增加
listenPort=9877

#保存退出

#启动mqnamesrv
#若未更改端口,可不带 -c conf/namesrv.properties

[root@localhost rocketmq-4.9.2]#  bin/mqnamesrv -c conf/namesrv.properties 
Java HotSpot(TM) 64-Bit Server VM warning: Using the DefNew young collector with the CMS collector is deprecated and will likely be removed in a future release
Java HotSpot(TM) 64-Bit Server VM warning: UseCMSCompactAtFullCollection is deprecated and will likely be removed in a future release.
load config properties file OK, conf/namesrv.properties
The Name Server boot success. serializeType=JSON


#后台启动mqnamesrv
nohup bin/mqnamesrv -c conf/namesrv.properties  > /dev/null 2>&1 &
#查看日志
tail -f ~/logs/rocketmqlogs/namesrv.log


启动broker

#进入目录
cd /usr/local/rocketmq-4.9.2/


vim conf/broker.conf
#追加以下两行配置
brokerIP1 = 你的rokcetMQ的broker服务ip
namesrvAddr=你的rokcetMQ的namesrv服务ip:9877

#启动broker
[root@localhost rocketmq-4.9.2]# bin/mqbroker -c conf/broker.conf 
The broker[broker-a, 192.168.0.162:10911] boot success. serializeType=JSON and name server is 192.168.0.162:9877

#后台启动broker
nohup bin/mqbroker -c conf/broker.conf   > /dev/null 2>&1 &
#查看日志
tail -f ~/logs/rocketmqlogs/broker.log