1) Open the catalina.sh and add additional JVM properties after CATALINA_BASE env settings.
# Only set CATALINA_HOME if not already set [ -z "$CATALINA_HOME" ] && CATALINA_HOME=`cd "$PRGDIR/.." >/dev/null; pwd` # Copy CATALINA_BASE from CATALINA_HOME if not already set [ -z "$CATALINA_BASE" ] && CATALINA_BASE="$CATALINA_HOME" CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=YourJMXPort -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Djava.rmi.server.hostname=YourTomcatHostname -Dcom.sun.management.jmxremote.password.file=$CATALINA_BASE/conf/jmx.psd -Dcom.sun.management.jmxremote.access.file=$CATALINA_BASE/conf/jmx.acl"
2) creating jmx.psd under folder $CATALINA_BASE/conf/ and put text content in it as below. So, we create a user name "controlRole" with password as "tomcat"
controlRole tomcat
3) creating jmx.acl under folder $CATALINA_BASE/conf/ and put text content in it as below. So, we assign user controlRole privilege of Read and Write.
controlRole readwrite
4) Open qshell and modify the file attribute as below. This will make sure that your account has read and write privilege to these access control files. We change this according to different account that start Tomcat.
call qp2term chmod 600 jmx.acl chmod 600 jmx.psd
5) On a Windows PC, run jconsole as below.
c:\Program Files\Java\jdk1.6.0_21\bin>jconsole
6) After jconsole is running, we need to input host name, port number, user name, and password.
7)Now, we can see jconsole connects to remote tomcat running on i5/OS.
Enjoy it for monitoring and tuning your Tomcat and servlet application.
No comments:
Post a Comment