VisualVm使用JMX的方式连接远程JVM
1、在catalina.sh中添加配置如下:
在其中“# ----- Execute The Requested Command -------------”之前插入一行(中间没有换行):
CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=机器IP"
特别注意:-Djava.rmi.server.hostname=机器IP这一行需要加上,不然可能本机能连上,远程连不上。
2、lsof -i:8999查看端口状态:

3、使用visualVm监控远程虚拟机:相对于使用jstatd的监控,使用jmx的方式会有更多的可以监控的功能,如Threads等。
原文转载至:https://blog.csdn.net/qq_32711309/article/details/105660499
浙公网安备 33010602011771号