Sunday, 13 March 2011

Enabling JConsole JMX Remote Monitoring of Tomcat

1) Make sure your CATALINA_HOME environment variable is set to the home directory of your catalina installation

2) Create a file runCatalina.bat somewhere hat looks like:

@startlocal
SET JAVA_OPTS= -Dcom.sun.management.jmxremote
SET JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.port=8086
SET JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.ssl=false
SET JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.authenticate=false
SET JAVA_OPTS=%JAVA_OPTS% -XX:PermSize=256m -XX:MaxPermSize=256m
SET JAVA_OPTS=%JAVA_OPTS% -server -Xms1024m -Xmx1024m
%CATALINA_HOME%\bin\catalina run
endlocal

3) If running Vista check this out, and apply the bugfix:
http://marxsoftware.blogspot.com/2008/01/making-jps-and-jconsole-work-with-java.html

I.e. need to make sure that "Everybody" has appropriate permission on the folder that JConsole uses

4) Run Catalina

5) Run jconsole (in your %JAVA_HOME%\bin directory).

6) Connect to the tomcat instancer remotely using hostname and 8086 (as defined above)

Instructions on what JConsole output means:
http://java.sun.com/javase/6/webnotes/trouble/TSG-VM/html/p1.html

No comments:

Post a Comment