1.单独jar包形式启动
pid=$(ps -ef | grep -v grep | grep ga-services-tpi-0.0.1-SNAPSHOT.jar | awk '{print $2}') if [ "$pid" != "" ]; then kill -9 $pid fi UEAP_JVM_ARGS=" -Xms4096m -Xmx10240m -Xmn3840m" nohup /opt/deploy_software/jdk1.8.0_191/bin/java -jar $UEAP_JVM_ARGS ga-services-tpi-0.0.1-SNAPSHOT.jar --server.port=8051 --spring.profiles.active=test >/dev/null 2>&1 & #不输出日志
nohup /opt/deploy_software/jdk1.8.0_191/bin/java -jar $UEAP_JVM_ARGS ga-services-tpi-0.0.1-SNAPSHOT.jar --server.port=8051 --spring.profiles.active=test >log.file 2>&1 & #输出日志到log.file
加上jmx远程测试 pid=$(ps -ef | grep -v grep | grep ga-services-tpi-0.0.1-SNAPSHOT.jar | awk '{print $2}') if [ "$pid" != "" ]; then kill -9 $pid fi JMX_JVM_ARGS=" -Dcom.sun.management.jmxremote" JMX_JVM_ARGS="$JMX_JVM_ARGS -Djava.rmi.server.hostname=10.12.113.20" JMX_JVM_ARGS="$JMX_JVM_ARGS -Dcom.sun.management.jmxremote.port=19999" JMX_JVM_ARGS="$JMX_JVM_ARGS -Dcom.sun.management.jmxremote.ssl=false" JMX_JVM_ARGS="$JMX_JVM_ARGS -Dcom.sun.management.jmxremote.authenticate=false" UEAP_JVM_ARGS=" -Xms4096m -Xmx10240m -Xmn3840m" nohup /opt/deploy_software/jdk1.8.0_191/bin/java -jar $UEAP_JVM_ARGS $JMX_JVM_ARGS ga-services-tpi-0.0.1-SNAPSHOT.jar --server.port=8051 --spring.profiles.active=test >/dev/null 2>&1 &