執行spring boot jar包

例:maila-manager-web-test01.sh

function start() {
        JAVA_OPTS="$JAVA_OPTS -server
               -Xmx512m
               -Xms256m
               -Xmn256m
               -XX:MetaspaceSize=64m
               -XX:MaxMetaspaceSize=256m
               -Xss256k
               -XX:+ExplicitGCInvokesConcurrent
               -XX:+UseConcMarkSweepGC
               -XX:+UseCMSInitiatingOccupancyOnly
               -XX:CMSInitiatingOccupancyFraction=70
               -XX:-UseBiasedLocking
               -XX:AutoBoxCacheMax=20000
               -XX:MaxTenuringThreshold=6
               -Xloggc:/dev/shm/gc_maila-manager-web.log
               -XX:+PrintGCApplicationStoppedTime
               -XX:+PrintGCDateStamps
               -XX:+PrintGCDetails
               -XX:+PrintCodeCache
               -XX:+UseGCLogFileRotation
               -XX:NumberOfGCLogFiles=2
               -XX:GCLogFileSize=10m
               -XX:+HeapDumpOnOutOfMemoryError
               -XX:HeapDumpPath=/home/admin/logs/ "

        nohup java $JAVA_OPTS -jar   /home/admin/duiba-deploy/maila-manager-web/maila-manager-deploy/build/libs/maila-manager-web-0.1.0.jar --spring.config.location=http://configserver.duiba.com.cn/maila-manager-web-pre.properties > /dev/null &
}



function stop() {
        process=`ps -ef | grep 'maila-manager-web' | grep -v "grep"|grep -v "restart"|grep -v "stop"| wc -l`
    if [[ 0 != $process ]];then
        ps -ef | grep 'maila-manager-web' | grep -v "grep"|grep -v "stop"|grep -v "restart"| awk '{print $2}' | xargs kill -15
    fi
    sleep 10
    if [[ 0 != $process ]];then
        ps -ef | grep 'maila-manager-web' | grep -v "grep"|grep -v "stop"|grep -v "restart"| awk '{print $2}' | xargs kill -9
    fi
}

function restart() {
        stop;
        sleep 1;
        start;
}


}

function status() {
        ps -ef | grep 'maila-manager-web' | grep -v grep| awk '{print $2}'

}
function help() {
    echo "$0 |start|stop|restart|status|"
}

if [ "$1" == "" ]; then
    help
elif [ "$1" == "stop" ];then
    stop
elif [ "$1" == "start" ];then
    start
elif [ "$1" == "restart" ];then
    restart
elif [ "$1" == "status" ];then
    status
else
    help
fi

執行: ./maila-manager-web-test01.sh start

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章