Remote JMX connection

前端 未结 12 1052
后悔当初
后悔当初 2020-11-29 15:54

I\'m trying to open a JMX connection to java application running on a remote machine.

The application JVM is configured with the following options:

  • com
12条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-29 16:25

    I've spend more than a day trying to make JMX to work from outside localhost. It seems that SUN/Oracle failed to provide a good documentation on this.

    Be sure that the following command returns you a real IP or HOSTNAME. If it does return something like 127.0.0.1, 127.0.1.1 or localhost it will not work and you will have to update /etc/hosts file.

    hostname -i
    

    Here is the command needed to enable JMX even from outside

    -Dcom.sun.management.jmxremote 
    -Dcom.sun.management.jmxremote.authenticate=false 
    -Dcom.sun.management.jmxremote.ssl=false 
    -Dcom.sun.management.jmxremote.port=1100
    -Djava.rmi.server.hostname=myserver.example.com
    

    Where as you assumed, myserver.example.com must match what hostname -i returns.

    Obviously, you need to be sure that the firewall does not block you, but I'm almost sure that this is not your problem, the problem being the last parameter that is not documented.

提交回复
热议问题