1、下载最新的安装包
github下载地址:https://github.com/apache/rocketmq/releases。本文安装版本为:rocketmq-all-5.1.0-bin-release.zip
2、安装JDK
3、上传并解压安装包
# 从本地电脑上传安装包到Linux服务器
scp E:\rocketmq-all-5.1.0-bin-release.zip [email protected]:/opt
# 解压安装包
yum install zip unzip -y
cd /opt
unzip rocketmq-all-5.1.0-bin-release.zip
3、启动NameServer
1)根据实际情况调整JVM参数
vi runserver.sh
也可以用命令修改
sed -i 's/-Xms4g -Xmx4g -Xmn2g/-Xms2g -Xmx2g -Xmn1g/g' ./runserver.sh
2)启动或关闭服务
cd /opt/rocketmq-all-5.1.0-bin-release/bin/
nohup sh mqnamesrv & # 启动NameServer
./mqshutdown namesrv # 关闭NameServer
3)查看服务是否正常启动
vi ~/logs/rocketmqlogs/namesrv.log
4、启动Broker
1)根据实际情况调整JVM参数
2)启动或关闭服务
cd /opt/rocketmq-all-5.1.0-bin-release/bin
nohup sh mqbroker -n localhost:9876 & # 启动Broker服务
./mqshutdown broker # 关闭Broker服务
3)查看服务是否正常启动
vi ~/logs/rocketmqlogs/broker.log
5、安装控制台(非必要)
1)下载dashboard:https://github.com/apache/rocketmq-dashboard
2)打包
clean package -Dmaven.test.skip=true
3)上传jar包并启动服务
scp E:\rocketmq-dashboard-1.0.1-SNAPSHOT.jar [email protected]:/opt
java -Xms1024m -Xmx2048m -jar rocketmq-dashboard-1.0.1-SNAPSHOT.jar --rocketmq.rocketmq.namesrvAddrs=localhost:9876
4)控制台访问地址(需开放防火墙端口):http://172.17.183.41:8080/#/
6、开放防火墙端口
firewall-cmd --zone=public --add-port=9876/tcp --permanent
firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --reload
标签:bin,opt,单机版,5.1,--,RocketMQ,release,安装,rocketmq From: https://www.cnblogs.com/zhi-leaf/p/17377917.html