#!/bin/sh
export JOB=/home/scada-servers/resource/jar/hisape-server-job-5.1-SNAPSHOT.jar
export ip=192.168.0.206
export JOB_port=8305
case "$1" in
start)
## 启动job
echo "--------job 开始启动--------------"
nohup java -Xms300m -Xmx500m -Xss512k -XX:PermSize=300m -XX:MaxPermSize=300m -jar $JOB --mysql.url=$ip --redis.url=$ip --rabbitmq.url=$ip --nacos.url=$ip --hisape-gateway=$ip --hisape-monitor-admin=$ip --hisape-tx-manager=$ip > /dev/null 2>&1 &
JOB_pid=`lsof -i:$JOB_port|grep "LISTEN"|awk '{print $2}'`
until [ -n "$JOB_pid" ]
do
JOB_pid=`lsof -i:$JOB_port|grep "LISTEN"|awk '{print $2}'`
done
echo "JOB pid is $JOB_pid"
echo "--------job 启动成功--------------"
echo "===startAll success==="
;;
stop)
P_ID=`ps -ef | grep -w $JOB | grep -v "grep" | awk '{print $2}'`
if [ "$P_ID" == "" ]; then
echo "===JOB process not exists or stop success"
else
kill -9 $P_ID
echo "JOB killed success"
fi
echo "===stop success==="
;;
restart)
$0 stop
sleep 2
$0 start
echo "===restart success==="
;;
esac
exit 0
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)