centos6.5使用JMX时远程连接不上的问题

来源:互联网 发布:红包自动抢软件 编辑:程序博客网 时间:2024/05/29 11:06

环境说明

  • 系统: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;
  • 防火墙开启

问题原因分析

  1. 如果使用了commons-daemon-native.tar.gz配置tomcat自启动,则jmx配置不能添加在$CATALINA_HOME/bin/catalina.sh中,因为此时系统启动没有使用该文件,需要jmx配置添加在/etc/init.d/tomcat7启动脚本中;检查jmx服务是否启动的方法:sudo netstat -anp | grep 9115;
  2. 必须关闭防火墙,因为jconsole连接会额外使用其他端口,这个端口是随机的;
0 0
原创粉丝点击