Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect JMC (Java Mission Control) to remote JVM in ubuntu?

Tags:

I am able to connect to JMC to the JVM while on the same system. However, I want to monitor a remote server. How do I connect my local JMC to my remote JVM?

like image 973
Sireesh Vattikuti Avatar asked Feb 27 '15 12:02

Sireesh Vattikuti


People also ask

How do I connect to JMC?

Click Help->Java Mission Control Help. 2. Check the JVM browser help. In the upcoming dialog you simply enter the host and port.

How do I run a JMC file in Linux?

If the JAVA_HOME/bin directory is in the PATH environment variable, you can start the JMC client by entering jmc at the command-line prompt (shell). Otherwise, you have to specify the full path to the JMC executable: JAVA_HOME\bin\jmc.exe (Windows) JAVA_HOME/bin/jmc (Linux, OS X)

Is JMC part of JDK?

The Java Mission Control (JMC) is a new JDK profiling and diagnostics tools platform for HotSpot JVM. It is a tool suite for basic monitoring, managing, and production time profiling and diagnostics with high performance.


1 Answers

It's all described in the documentation:
1. Click Help->Java Mission Control Help.
2. Check the JVM browser help.

For more detailed information, check out:
http://docs.oracle.com/javase/7/docs/technotes/guides/management/agent.html

First you need to enable the external JMX agent on the server. You do this by adding the relevant com.sun.management.jmxremote to the command line flags for the server JVM you wish to connect to. Here is a simple example of a set of system properties that can be used. They disable security and authentication, so NEVER use it like this in production:

-Dcom.sun.management.jmxremote.port=7091 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false 

Next you create a custom connection in JMC. You do this by clicking the "Create custom connection" button in the JVM browser: Location of create custom connection button

In the upcoming dialog you simply enter the host and port.

If you run into trouble, first check the last chapter of the documentation included with JMC (Frequently Asked Questions): Where to Find the Help

If that does not help, the JMC Forum has a more extensive FAQ: https://community.oracle.com/message/11182417#11182417.

like image 160
Hirt Avatar answered Sep 19 '22 21:09

Hirt