当前位置:Gxl网 > 互联网 > 安装RocketMQ

安装RocketMQ

时间:2021-07-01 10:21:17 帮助过:1人阅读

cd /opt/
wget https://archive.apache.org/dist/rocketmq/4.2.0/rocketmq-all-4.2.0-bin-release.zip
unzip rocketmq-all-4.2.0-bin-release.zip -d rocketmq-all-4.2.0
cd rocketmq-all-4.2.0
sed -i ‘s/-server -Xms8g -Xmx8g -Xmn4g\"/-server -Xms2g -Xmx2g -Xmn1g\"/‘ /opt/rocketmq-all-4.2.0/bin/runbroker.sh
sed -i ‘s/-XX:MaxDirectMemorySize=15g\"/-XX:MaxDirectMemorySize=1g\"/‘ /opt/rocketmq-all-4.2.0/bin/runbroker.sh
sed -i ‘s/-server -Xms4g -Xmx4g -Xmn2g/-server -Xms2g -Xmx2g -Xmn1g/‘ /opt/rocketmq-all-4.2.0/bin/runserver.sh
mkdir -p /opt/rocketmq-all-4.2.0/logs/rocketmqlogs
cat >> /opt/rocketmq-all-4.2.0/start << EOF
#!/bin/sh
nohup sh ./bin/mqnamesrv > ./logs/rocketmqlogs/namesrv.log > /dev/null 2>&1 &
nohup sh ./bin/mqbroker -n localhost:9876 > ./logs/rocketmqlogs/broker.log > /dev/null 2>&1 &
EOF
chmod +x /opt/rocketmq-all-4.2.0/start
bash /opt/rocketmq-all-4.2.0/start

jps

cat >> /opt/rocketmq-all-4.2.0/stop << EOF
#!/bin/sh
sh /opt/rocketmq-all-4.2.0/bin/mqshutdown broker > /dev/null 2>&1 &
sh /opt/rocketmq-all-4.2.0/bin/mqshutdown namesrv > /dev/null 2>&1 &
echo "Please wait process to exit! check it type jps"
EOF
chmod +x /opt/rocketmq-all-4.2.0/stop

相关教程