Window jconsole failed to connect to linux server remotely

According to the documentation on the oracle website there is no problem using jconsole locally. But when I connect from windows to linux (centos5.4), it always fails to connect).
The reason is that the RMI configuration file given to jconsole by the JVM on Linux is incorrect.
The jvm uses the IP address of hostname -i, and I have 127.0.0.1 on my /etc/hosts, so the remote connection is always impossible.
Just add -Djava.rmi.server.hostname=192.168.0.10 to the java startup parameters to display the IP address returned by the JVM to jconsole.
JAVA_OPTS="-Xms256m -Xmx512m -XX:MaxPermSize=128m -Dcom.sun.management.jmxremote.port=1011 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=192.168.1.210"

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326409829&siteId=291194637