Skip to content

Instantly share code, notes, and snippets.

@obohrer
Created November 9, 2011 16:05
Show Gist options
  • Save obohrer/1351906 to your computer and use it in GitHub Desktop.
Save obohrer/1351906 to your computer and use it in GitHub Desktop.
Enable JMX remote
Server side :
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=1099 -Djava.rmi.server.hostname=127.0.0.1 -Djava.rmi.server.useLocalHostname=true
Client side :
Forward port 1099 ==> ssh -L 1099:localhost:1099 username@serverip
Download this logging properties file : http://blogs.oracle.com/jmxetc/resource/logging.properties
start jconsole using the downloaded properties file :
$ jconsole -debug -J"-Djava.util.logging.config.file=logging.properties" localhost:1099
Find the port (48049 in this case) :
FINER: [javax.management.remote.rmi.RMIConnector: rmiServer=RMIServerImpl_Stub[UnicastRef [liveRef: [endpoint:[127.0.0.1:48049](remote)
Forward the port choosed at runtime : Forward port 48049 ==> ssh -L 48049:localhost:48049 username@serverip
On jconsole, try to connect to your server again and it should work !
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment