5 Working with Remote JVMs

JMC allows you to connect to a remotely running Java application or JVM using:

Java Management Extension

Java virtual machine (JVM) uses Java Management Extensions (JMX) technology over a Remote Method Invocation (RMI) connector, known as JMXRMI to enable monitoring and management features.

Prerequisites:
  • To connect to the Java application (remote JVM) from JMC, you must start the remote JVM using JMX JVM arguments such as:
    • -Dcom.sun.management.jmxremote
    • -Dcom.sun.management.jmxremote.authenticate
    • -Dcom.sun.management.jmxremote.port
    • -Dcom.sun.management.jmxremote.ssl

    See Monitoring and Management Using JMX Technology for complete list of arguments and their values.

  • Ensure that there are no firewall rules on the server or client (the machine where JMC is running), which block connectivity to the JMX remote port.
  • Obtain the configuration details such as port number, host name, authentication credentials, and digital certificates from your remote JVM, if any.
SSL is enabled by default when you enable remote monitoring and management. To use SSL, you need to set up a digital certificate on the system and configure SSL on the server application or JVM.

Once SSL is enabled on the remote JVM, configure JMC using the same set of digital certificates used in the remote JVM.

To set digital certificates in JMC:
  1. Go to Window, Preferences, JDK Mission Control, and click JMXRMI.

    Note:

    On macOS, preferences are at JDK Mission Control, Settings, JDK Mission Control, JMXRMI.
  2. Browse and select the Key Store location.
  3. Enter the Key Store Password.
  4. Browse and select the Trust Store location.
  5. Enter the Trust Store Password.
  6. Click Unlock to provide the master password.
  7. In the Set Master Password screen, type the password twice and click OK.
  8. Click Apply.
  9. Restart JMC.

Creating New Custom Connection

You can add connections to favorite JVMs so that they are always available in the JVM Browser.

To add a new custom connection:
  1. Right click in the JVM Browser tab and select New Connection.
    Alternatively, go to File, Connect, select Create a new connection, and click Next.
  2. Enter the Host name and Port number of the JVM to connect to.
    Alternatively, you can provide the Custom JMX service URL in the format:
    service:jmx:rmi:///jndi/rmi://<<remote-host>>:7091/jmxrmi
  3. If client authentication is enabled in the remote JVM, specify the User name and Password for authentication. Select Store credentials in settings file to encrypt them using a master password.
  4. Enter the Connection name.
  5. Click Finish to create the connection.
    Alternatively, click Next and select either to Start JMX Console or Start Flight Recording.

Note:

If SSL is not enabled, a warning message is displayed recommending you to secure your connection using SSL configuration.

Java Discovery Protocol (JDP)

The Java Discovery Protocol (JDP) enables the JVM Browser to list JVM instances across the same network subnet.

Prerequisites:
  • Connect to the Java application (remote JVM) from JMC using JDP arguments.

    See Java Discovery Protocol (JDP) documentation for more details.

  • Ensure that there are no firewall rules on the server or client (the machine where JMC is running), which block connectivity.
To set up JDP preferences:
  1. Go to Window, Preferences, JDK Mission Control, JVM Browser, and click JDP.
  2. Select the auto-discover checkbox.
    Click OK when prompted to enable auto discovery in safe environment.
  3. Enter the IP address of Multicast group to join. Default value is 224.0.23.178.
  4. Enter the Multicast port number. Default value is 7095.
  5. Enter the Heart Beat Timeout in seconds. Default is 12.
  6. Restart JMC for the changes to take effect.

    Note:

    You can modify the default values as required.
JMC will identify the JDP enabled JVMs, running on the configured network, and let you monitor and record JFRs.

See Troubleshooting Tricks for solutions to commonly occurring issues.