start-stop服务器启动
springBoot打成jar包扔到linux服务器
start.sh
JAVA_OPTS="-Xms250M
-Xmx250M
-XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=80
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=/home/XXX/dump
-XX:+PrintGCDetails
-XX:+PrintGCTimeStamps
-Xloggc:/home/XXXX/dump/gc_trace.log
-XX:+UseGCLogFileRotation
-XX:NumberOfGCLogFiles=3
-XX:GCLogFileSize=512k
-Djava.rmi.server.hostname=10.2.14.201
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=19997
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
"
----------------------------------------------------------
指定端口 -Dserver.port=9091
指定配置 -Dspring.config.location=/data/xxx//config/
nohup $JAVA_HOME/bin/java $JAVA_OPTS -jar -Dserver.port=9099 -Dspring.config.location=/data/xx/config/ /data/xxx.jar >/data/run2.log 2>&1 &
nohup java -Dfile.encoding=utf-8 -jar XXX-1.0-SNAPSHOT.jar >/usr/local/XXX/run.log 2>&1 &
nohup $JAVA_HOME/bin/java $JAVA_OPTS -cp /home//tongxun809new1/test.jar com.ltmonitor.jt809.app.Main808Service start >/dev/null 2>&1 &
#nohup java -server -Xms256m -Xmx512m -jar XXX.jar &
#nohup $JAVA_HOME/bin/java -server -Xms256m -Xmx512m -jar Web-1.0.0.jar &
#nohup java -server -Xms256m -Xmx256m -jar -Dserver.port=9090 -Dspring.profiles.active=dev sentinel-dashboard.jar > Log.log 2>&1 &
stop.sh
pid=`ps -ef|grep java|grep XXX-1.0-SNAPSHOT.jar |awk '{print $2}'`
if [ -z $pid ]; then
echo 'xxxnot runing'
else
echo 'kill pid ' $pid
kill $pid
sleep 5
ps -ef| grep XXX-1.0-SNAPSHOT.jar
fi
tail -f run.log
Error: Invalid or corrupt jarfile /data/tetest.jar