一、环境信息

远程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上,

jconsole连接远程Tomcat应用

 

jconsole连接远程Tomcat应用

 

2、命令行启动

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

jconsole连接远程Tomcat应用

 

重要的参考信息:

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

相关文章:

  • 2021-12-03
  • 2021-11-01
  • 2022-12-23
  • 2021-10-12
  • 2021-12-18
  • 2021-10-06
  • 2021-04-01
  • 2021-09-23
猜你喜欢
  • 2021-10-07
  • 2021-08-25
  • 2021-09-23
  • 2021-10-26
  • 2021-05-14
相关资源
相似解决方案