tomcat 或springboot启动项目配置jmx参数与执行命令

1.jconsole远程连接tomcat配置:

-Djava.rmi.server.hostname=192.168.0.2

-Dcom.sun.management.jmxremote

-Dcom.sun.management.jmxremote.port=2011

-Dcom.sun.management.jmxremote.ssl=false

-Dcom.sun.management.jmxremote.authenticate=false

2.springboot项目启动配置jmx:

 nohup /usr/bin/java -server -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=30019 -Xms2048m -Xmx2048m -Xmn1280m -XX:PermSize=128m -XX:MaxPermSize=700m -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+CMSClassUnloadingEnabled -XX:SurvivorRatio=8 -XX:+ExplicitGCInvokesConcurrent -Djava.rmi.server.hostname=192.168.30.139 -Dcom.sun.management.jmxremote.port=8999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -jar /opt/place-alpha/place-alpha.jar > /dev/null 2>&1 &

你可能感兴趣的:(编程人生,java,架构,经验分享)