zoukankan      html  css  js  c++  java
  • java 程序启动脚本

    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 &
  • 相关阅读:
    TestNG系列(四)TestNG监听器
    SpringBoot中Conditional的条件
    TCP的四次挥手与三次握手
    [Lamada] lamda流操作
    [Spring] 封装request 自定义添加parameter
    AES加密Demo
    [转]数据库软件架构,到底要设计些什么
    [正则表达式]
    [mysql] 查询配置文件读取位置和顺序
    [MySQL]错误日志
  • 原文地址:https://www.cnblogs.com/lgjava/p/13900584.html
Copyright © 2011-2022 走看看