简单shell 公司测试服务器 rocket 总是报 内存不足,懒得寻找彻底解决办法,所以偷个懒
写个脚本自动重启
#!/bin/sh
while true;do
count=`ps -ef|grep rocket|grep -v grep`
if [ "$?" != "0" ];then
echo ">>>>no mamesrv,run it"
nohup sh /usr/local/rocketmq/rocketmq-4.8.0/bin/mqnamesrv &
nohup sh /usr/local/rocketmq/rocketmq-4.8.0/bin/mqnamesrv -c /usr/local/rocketmq/rocketmq-4.8.0/conf/9877.properties &
else
echo ">>>>mamesrvis runing..." >> /usr/local/rocketmq/rocketmq-4.8.0/log/1.log
fi
sleep 5
done