-
-
Save cccaternberg/85e2eca4eeb04187ec52f88be71e11d0 to your computer and use it in GitHub Desktop.
How to enable remote JMX access
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java -jar yourApp.jar [JVM_OPTIONS] | |
For local host access only JVM_OPTIONS are: | |
-Dcom.sun.management.jmxremote | |
-Dcom.sun.management.jmxremote.port=9010 | |
-Dcom.sun.management.jmxremote.host=127.0.0.1 | |
-Dcom.sun.management.jmxremote.local.only=true | |
-Dcom.sun.management.jmxremote.authenticate=false | |
-Dcom.sun.management.jmxremote.ssl=false | |
For full remote access JVM_OPTIONS are: | |
-Dcom.sun.management.jmxremote | |
-Dcom.sun.management.jmxremote.port=9010 | |
-Dcom.sun.management.jmxremote.local.only=false | |
-Dcom.sun.management.jmxremote.authenticate=false | |
-Dcom.sun.management.jmxremote.ssl=false | |
Prefer IPv4 over IPv6: | |
-Djava.net.preferIPv4Stack=true | |
Example: | |
java -jar MyJar.jar -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.local.only=true -Dcom.sun.management.jmxremote.host=127.0.0.1 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.net.preferIPv4Stack=true | |
More: | |
http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#from my mashine
#open SOCK to remote mashine
ssh -fN -D 7777 user@remotehost
##start jconsole
jconsole -J-DsocksProxyHost=localhost -J-DsocksProxyPort=7777 service:jmx:rmi:///jndi/rmi://localhost:9010/jmxrmi -J-DsocksNonProxyHosts=
#start the process on remote mashine, paramters see this gist