Using the JDK5 JConsole JMX Console
The jconsole utility that ships with the Sun JDK5 provides a new level of VM information. The configuration of jconsole is discussed here:
http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html
Another good overview is here:
http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html
To use jconsole, obviously you need to be using a release version of jdk5+. See the JBoss vs Java JDK Version Matrix page for which jboss versions work with jdk5.
Using jconsole with a Local Server
To enable the JMX agent for local access, set the com.sun.management.jmxremote system property in the run.conf/run.bat script. For example, in run.conf:
#
# Specify options to pass to the Java VM.
#
if [ "x$JAVA_OPTS" = "x" ]; then
JAVA_OPTS="-server -Xms128m -Xmx128m"
fi
# Enable the jconsole agent locally
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote"
Next, launch jconsole, $JAVA_HOME/bin/jconsole. This will bring up a java app with a connection dialog like:
Using jconsole with a Remote Server
To enable monitoring and management from remote systems, set the com.sun.management.jmxremote.port=NNN system property, where NNN is any free port number > 1024 in the run.conf/run.bat script. For example, in run.conf:
#
# Specify options to pass to the Java VM.
#
if [ "x$JAVA_OPTS" = "x" ]; then
JAVA_OPTS="-server -Xms128m -Xmx128m"
fi
# Enable the jconsole agent remotely on port 12345
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=12345"
Note that this requires password security to be configured. To disable security and ssl transport, add two additional properties:
# Enable the jconsole agent remotely on port 12345
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=12345"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"
To connect the jconsole to use specify the hostname:NNN combo for the server. NNN is the same port number specified in the system property, for example $JAVA_HOME/bin/jconsole lamia:12345. You can also start jconsole and then use the Connection/New Connection... menu item to bring up a connect dialog:
Referenced by:
FAQJBossJMX
ThreadDump
Other languages:
Log in to make links between pages
Attachments: