You need to do following configuration to enable Remote JMX monitoring on tomcat server.
- Copy
jmxremote.password.templatelocated atJRE_HOME/lib/managementinside the same folder with the namejmxremote.password. - Edit this
jmxremote.passwordfile, uncomment last two lines starts withmonitorRoleandcontroleRole, instead of QED and R&D set some good password for both of them. - Change directory to
CATALINA_HOME/binfrom where you start the tomcat. - You will find
setenv.sh(if you don’t find it create one) and add following line inside file
CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote.port=9000 -Djava.rmi.server.hostname=127.0.0.1 -Dcom.sun.management.jmxremote.ssl=false"
- Here in above line you need to set proper ip address which is accessible from remote machine to
-Djava.rmi.server.hostnameand set available port number to-Dcom.sun.management.jmxremote.port - Once all this settings are done
restart/starttomcat.
Above steps will enable remote JMX on this JVM. To monitor it using jconsole from remote machine follow below steps from remote machine.
- Start
jconsole
$ jconsole
- Select Remote Process option and enter
<remote ip address>:<port>, specify username asmonitorRoleorcontroleRoleand password that you set insidejmxremote.passwordfile for corresponding user.
This should start remote monitoring of remote JVM tomcat.