JConsole is a tool that comes with the standard Oracle/Sun version of the Java JDK. It's helpful in watching the overall behavior of a Java Virtual Machine.
If you want to set this up to monitor a Tomcat instance, you must add a few JVM parameters in catalina.sh:
-Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.password.file=/home/scott/apache-tomcat/conf/jmxremote.password -Dcom.sun.management.jmxremote.access.file=/home/scott/apache-tomcat/conf/jmxremote.access
Also you must create 2 files:jmxremote.access
tomcat readonly admin readwrite
jmxremote.password
tomcat <password> admin <password>
Add an entry in your server.xml under <Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener"
rmiRegistryPortPlatform="10001" rmiServerPortPlatform="10002" />
Make sure $CATALINA_HOME/lib has the catalina-jmx-remote.jar file available.
Connect to it using JConsole with a connection string like this:
service:jmx:rmi://<hostname/IP address>:10002/jndi/rmi://<hostname/IP address>:10001/jmxrmi
Add new comment