How to Enable JMX in Tomcat
As a Tomcat administrator, we should enable JMX in tomcat to monitor Heap Memory, Threads, CPU Usage, Classes, and configure various MBeans.
I will try to show step by step process to enable and connect to Tomcat with JConsole.
Note: Please have JDK installed on your windows server.
Step 1: Go to path where you have Tomcat installed and then go to the bin directory.
Setp 2: update following variables/parameters under setenv.sh
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=11111 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false Note :
- Dcom.sun.management.jmxremote.port=11111 Please modify the port number as per your need, make sure the port is free ( netstat –anlp | grep 11111)
- Dcom.sun.management.jmxremote.ssl=false This means connect without SSL
- Dcom.sun.management.jmxremote.authenticate=false This means no authentication needed when you use JMX client to connect to Tomcat instance.
Step 4: Restart tomcat server. Step 5 : On you windows server, go to the path where JDK is installed and then launch jconsole from **/bin directory. Step 6: In Jconsole pop-up, select "Remote Process" and the enter following information. tomcat_server_host_name:11111 username: Tomcat_username Password: Password Step 7: Click on connect.
Tomcat Server – Configuration & Administration