zoukankan      html  css  js  c++  java
  • JVM相关参数的采集

    1、以-jar方式启动jar包:

    java -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=40100 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=localhost -jar yineng-monitor-1.0.0.jar 

    2、tomcat启动项目的:

     window下:

    在start.bat文件中加入

    set JMX_REMOTE_CONFIG=-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=40200 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=127.0.0.1
    set CATALINA_OPTS=%CATALINA_OPTS% %JMX_REMOTE_CONFIG%

    liunx下:

    在catalina.sh文件中加入

    CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote -Djava.rmi.server.hostname=127.0.0.1 -Dcom.sun.management.jmxremote.port=40200 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"

     为避免配固定IP,思考的办法,下面两种方式:

    IP=$(ifconfig |grep '10.18.18' |awk -F':' '{print $2}'|awk '{print $1}')
    JAVA_OPTS='-Xms5120m -Xmx5120m -XX:PermSize=256M -XX:MaxNewSize=512m -XX:MaxPermSize=512m'
    CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote -Djava.rmi.server.hostname=$IP -Dcom.sun.management.jmxremote.port=40200 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
    IP=$(ifconfig eth0 | sed -n "2s/[^:]*:[ 	]*([^ ]*) .*/1/p")
    JAVA_OPTS='-Xms5120m -Xmx5120m -XX:PermSize=256M -XX:MaxNewSize=512m -XX:MaxPermSize=512m'
    CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote -Djava.rmi.server.hostname=$IP -Dcom.sun.management.jmxremote.port=40200 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
  • 相关阅读:
    配置navigation bar外观
    加急审核
    UIButton中setTitleEdgeInsets和setImageEdgeInsets的使用
    打开某个好友的聊天界面
    ALAssets的两种用法
    更改appstore开发商名字
    回调函数的使用
    相应字体所占的位置大小
    IOS的变量前加extern和static字段
    iOS开发代码规范(通用)
  • 原文地址:https://www.cnblogs.com/kzfy/p/5591415.html
Copyright © 2011-2022 走看看