Performance Zone is brought to you in partnership with:

My name is Zemian Deng, and I am a Senior Application Engineer working at Oracle for the Enterprise Knowledge Management product. NOTE: The views expressed on my blog and social network are my own and do not necessarily reflect the views of my employer. Zemian is a DZone MVB and is not an employee of DZone and has posted 84 posts at DZone. You can read more from them at their website. View Full User Profile

How to Monitor Multiple JVM's on a Server with VisualVM

03.18.2014
| 3197 views |
  • submit to reddit
In the last article I have shown you how to start WebLogic Server with single admin and mulitiple managed servers. After those are started, how do you go check their health status? You can use the admin's /console webapp. But there  is also another tool that comes with all the default Oracle/Open JDK 6+: the VisualVM. I will show you how to get that up and running to monitor multiple JVM's.

On the server where you run your JVM servers, do this:

1. cd into $HOME and create a file named "jstatd.all.policy" with the following:

  grant codebase "file:${java.home}/../lib/tools.jar" {
  permission java.security.AllPermission;
  };
2. Run this command:

  jstatd -J-Djava.security.policy=jstatd.all.policy &
3. Now go back to your PC and open a terminal and run the following:
  jvisualvm &
4. Inside VisualVM, add a Remote host of your server and you should see all the JVM that started there.

Here is an example of how it looks like:

Published at DZone with permission of Zemian Deng, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Matthias Bläsing replied on Wed, 2014/03/19 - 8:33am

 If you are running glassfish - it exposes a good part of its health also via REST and JMX. The last part is relevant in this context, as you can access the JMX parts remotly and authenticated (same as admin ui).

Make sure that the "VisualVM-MBeans" plugin is installed.

In jvisualvm add a remote host, right click on the new host and choose "Add JMX connection", enter as connection string: "<hostname>:8686" (for a default installation). If you enabled authentication for you glassfish admin ui (who wouldn't in production?!), choose "use security credentials" and enter your username and password. Klick OK.


Zemian Deng replied on Wed, 2014/03/19 - 10:47pm in response to: Matthias Bläsing

 Good to know Matthias. Thanks for the note!

Benno Markiewicz replied on Mon, 2014/03/24 - 1:48pm

The example image cannot be displayed.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.