Remote jconsole JMX using mystery port
I am trying to use jconsole to monitor a JVM running on a remote machine. I am doing this over ssh. So I told the remote JVM to start with
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.port=8010
also I happen to have set
-Djava.rmi.server.hostlame=localhost
but I don't think that is relevant
Then I forwarded the port 8010 to the remote machine and connect with
jconsole localhost:8010
But that did not work. So I go to linux box and type
netstat -atnp | grep java
which reveals that Java is listening also on port 32796
I start and stop my process a few time to see that this is a randomly chosen port. I then use ssh to forward this port and voila, jconsole is now working across ssh.
Anyone have any idea what this mystery port is and any way to set it on the command line of the monitored JVM?

