Can't connect to remote JMX using VisualVM but using JConsole

I am trying to connect to a remote JMX service using VisualVM 1.3.8 with JRE 1.8.0. Doing the exact same communication with JConsole works fine, however trying to use the same parameters with VVM just hangs at the Add Services step. I have looked at the VVM log but literally nothing is written.

I also read here in the VVM remote JMX doc:

Note. To get and display information about applications running on a remote host, the jstatd utility must be running on the remote host.

This puzzles me, since I can make a JMX remote connection using JConsole, and as far as I can tell, jstatd does not work on the remote.

Does anyone know if jstatd is only required for VVM as a remote JMX client? Since JMX connection can be made from JConsole between the same client and server endpoints, then there is no network / firewall problem etc.

Also, I am really puzzled where else to look for clues?

+3


source to share


1 answer


I had the same problem when I switched from Java 7 to 8 using SOCKS where I was updating my proxy settings through VisualVM -> Tools -> Plugins -> Settings -> Proxy Settings

. However, I managed to achieve the following results:

  • Start the JVM with the following parameters:

-Dcom.sun.management.jmxremote.port=<JMX_PORT> -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false

Note that you can obviously do something more secure, both wrt SSL and authentication.



  1. Install SOCKS proxy from your localhost to remote server:

ssh -D<SOCKS_PORT> -vvv -N <REMOTE_HOST>

  1. Run any of these commands on localhost:

jconsole -J-DsocksProxyHost=localhost -J-DsocksProxyPort=<SOCKS_PORT> service:jmx:rmi:///jndi/rmi://<REMOTE_HOST:JMX_PORT>/jmxrmi jvisualvm -J-DsocksProxyHost=localhost -J-DsocksProxyPort=<SOCKS_PORT> --openjmx <REMOTE_HOST>

+1


source







All Articles