Debugging JConsole Connection Failed

后端 未结 8 1152
臣服心动
臣服心动 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
    

提交回复
热议问题