How to remotely monitor tomcat operation
This article is about how to remotely monitor the operation of tomcat. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
1. The bin directory under the jdk installation directory has the jvisualvm.exe executive program.
2. Install visualgc plug-ins: tools-- > plug-ins
3. Select visual GC when the following interface appears.
The second way is to manually download and install the plug-in:
Plug-in download address: https://github.com/oracle/visualvm/releases
Enter the interface: https://visualvm.github.io/pluginscenters.html
Click the corresponding plug-in address: https://visualvm.github.io/uc/8u131/updates.xml.gz
Plug-in name: com-sun-tools-visualvm-modules-visualgc.nbm
Enter the following interface
4. Download catalina-jmx-remote.jar and put it in the lib directory of the tomcat installation directory.
Download address: http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.22/bin/extras/
5. Modify the conf/server.xml of the tomcat installation directory
Add the following configuration below
6. Create a new file jmxremote.password in the bin directory of the installation directory of tomcat. The content is: admin admin.
Note: two admin indicate user name and password
7. Create a new file jmxremote.access in the bin directory of the installation directory of tomcat. The content is: admin readwrite.
Remarks: denote users and permissions respectively
8. Modify and add bin/catalina.sh under the tomcat installation directory
Linux system:
JAVA_OPTS='-Dcom.sun.management.jmxremote=true-Djava.rmi.server.hostname=120.25.86.58-Dcom.sun.management.jmxremote.authenticate=false-Dcom.sun.management.jmxremote.ssl=false'
Windows system:
Set JAVA_OPTS= "- Dcom.sun.management.jmxremote=true-Djava.rmi.server.hostname=127.0.0.1-Dcom.sun.management.jmxremote.authenticate=false-Dcom.sun.management.jmxremote.ssl=false"
9. Ports for opening linux firewall: 10001 and 10002
-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 10001-j ACCEPT
-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 10002-j ACCEPT
Be careful to restart the firewall to take effect
10. Start tomcat and jvisualvm.exe
Thank you for reading! This is the end of this article on "how to remotely monitor the operation of tomcat". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!