环境说明
- 系统:centos6.5;
- tomcat: 7.059,使用commons-daemon-native.tar.gz配置自启动;
- java:1.7.0_75-b13;
- /etc/hosts:
- $ServerIp localhost
- ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
- $ServerIp iZ258xcfjroZ localhost
- jmx配置:
- -Dcom.sun.management.jmxremote
- -Dcom.sun.management.jmxremote.port=9115
- -Dcom.sun.management.jmxremote.authenticate=false
- -Dcom.sun.management.jmxremote.ssl=false;
- 防火墙开启
问题原因分析
- 如果使用了commons-daemon-native.tar.gz配置tomcat自启动,则jmx配置不能添加在$CATALINA_HOME/bin/catalina.sh中,因为此时系统启动没有使用该文件,需要jmx配置添加在/etc/init.d/tomcat7启动脚本中;检查jmx服务是否启动的方法:sudo netstat -anp | grep 9115;
- 必须关闭防火墙,因为jconsole连接会额外使用其他端口,这个端口是随机的;