Debugging JConsole Connection Failed

后端 未结 8 1150
臣服心动
臣服心动 2020-12-29 04:34

I have a web application deployed to a remote resin server, and it has JMX turned on.

I can telnet to the remote server i.e

franz@see:/tmp$ telnet &l         


        
相关标签:
8条回答
  • 2020-12-29 05:06

    If you are accessing a machine behind a firewall, you need to open both JMX and RMI ports.
    In this context, you are much better off forcing the value for RMI than relying on the auto assigned
    In my case, I was trying to access Tomcat so I had to do the following:

    #!/bin/sh
    CATALINA_OPTS="$CATALINA_OPTS -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8008 -Dcom.sun.management.jmxremote.rmi.port=8007 -Dcom.sun.
    management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
    

    and then

    firewall-cmd --zone=public --add-port=8008/tcp --permanent
    firewall-cmd --zone=public --add-port=8007/tcp --permanent
    firewall-cmd --reload
    
    0 讨论(0)
  • 2020-12-29 05:07

    This finally made it work for me : Giving this extra option: -Djava.rmi.server.hostname=<ip addres where jvm is running

    So all the vm arguments used to open jconsole from a remote machine, the jvm on the remote machine must be started with

     -Dcom.sun.management.jmxremote.authenticate=false  -Dcom.sun.management.jmxremote.port=<port> -Dcom.sun.management.jmxremote -com.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=<ip address>
    

    The entire process is listed here

    0 讨论(0)
提交回复
热议问题