jconsole连接远程Tomcat应用

一、环境信息

远程tomcat:linux 64位 centos 7 上tomcat 8

本机:windows7 

 

二、步骤

linux上,在tomcat安装目录的bin下,新建setenv.sh,内容如下:

export JAVA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"

 

另:

如果在windows下,可以创建setenv.bat脚本,内容如下:

set JAVA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"

 

三、本机连接

1、通过界面启动

在本机的jconsole上,

 

 

2、命令行启动

也可以cmd启动,如下:(当然,也可以直接jconsole 本机进程pid的方式连接本地进程,针对多个进程有相同名字时,有奇效)

 

重要的参考信息:

https://docs.oracle.com/javase/8/docs/technotes/guides/management/agent.html#gdenl

https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/tooldescr009.html#BABDCICF

posted @ 2018-06-25 15:08  三国梦回  阅读(312)  评论(0编辑  收藏  举报