JMX Monitoring of GlassFish Servers

Did you ever wonder what this message in your GlassFish server.log file means?

JMXStartupService has started JMXConnector on JMXService URL service:jmx:rmi://192.168.2.102:8686/jndi/rmi://192.168.2.102:8686/jmxrmi

It means you can monitor any GlassFish server process, remotely or locally, using any standard Java Management Extensions (JMX) client.  Examples: jconsole or jvisualvm.  

Copy the part of the log message that starts with "service:" into the Add JMX Connection dialog of jvisualvm:

or into the New Connection dialog of jconsole:

(The full string is truncated in the on-screen display, but if you copied from the server.log and pasted into the form it should all be there.)

The examples above are for a DAS, and your host will probably be different.  The server.log files for other GlassFish servers (instances) will have similar log entries giving the JMX connection string to use for those processes.  Look for the host and/or port to be different.

Once you have connected you have normal access to all the JVM statistics and controls, such as threads, memory, etc. 

Note a few things about security:

  1. Here we've assumed you are using the default admin username and password.  If you are not, just enter a valid admin username and password for your installation.
  2. You can use JMX clients that support MBeans to view the GlassFish configuration.  When you connect to the DAS, you can also change that configuration, but when connected to an instance you can only view configuration.
  3. To use a JMX client on one system to connect to a GlassFish server running on another system, you need to enable secure admin if you have not already done so:
    • asadmin change-admin-password (respond to the prompts)
    • asadmin enable-secure-admin
    • asadmin restart-domain (as prompted in the output from enable-secure-admin)
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

News and musings on the technology I work on at Oracle.

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today