Skip to content

Instantly share code, notes, and snippets.

@IgorBerman
Last active April 9, 2017 07:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IgorBerman/447657479f9f356c45ea7ba89c07324e to your computer and use it in GitHub Desktop.
Save IgorBerman/447657479f9f356c45ea7ba89c07324e to your computer and use it in GitHub Desktop.
visualvm ec2 jmx
1. Setup your process java properties
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=1098 -Dcom.sun.management.jmxremote.rmi.port=1098 -Djava.rmi.server.hostname=127.0.0.1
2. ssh to your server on ec2 with a) port forwarding of 1098(jmx port) and b) with socks server on 10003
ssh -L 1098:127.0.0.1:1098 -D 10003 my.ec2.instance.com
3. Open visualvm with socks proxy on on same proxy port
jvisualvm -J-DsocksProxyHost=localhost -J-DsocksProxyPort=10003
4. create local jmx connection on localhost:1098 in visualvm
5. enjoy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment