Last active
May 7, 2022 16:30
-
-
Save m-szalik/93c559bf2ad964078e1e 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 | |
Do we need to set the below property when using Java 8 ?
Dcom.sun.management.jmxremote.local.only=true
As per the below thread, it seems, this is ineffective
https://support.oracle.com/knowledge/Middleware/1641501_1.html
I've explained this in detail: Remote monitoring with visualvm and JMX
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👍