VisualVM remote monitoring tomcat configuration

Remote server: CentOS Linux release 7.0.1406
JDK: 1.7
TOMCAT: 7.0.53

Local: windows 7
JDK 1.7

Steps:
1. Open startup.sh in the tomcat/bin directory, and add the following command in front of the last line:
export CATALINA_OPTS=" $CATALINA_OPTS  
-Dcom.sun.management.jmxremote -Djava.rmi.server.hostname=xxx.xxx.xxx.xxx -Dcom.sun.management.jmxremote.port=xxx -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file=../conf/jmxremote.password -Dcom.sun.management.jmxremote.access.file=../conf /jmxremote.access"

where ip and port are modified to their own server settings

2. Copy the two files jmxremote.access and jmxremote.password.template under /jdk1.6.0_45/jre/lib/management/, copy the tomcat/conf folder , and rename the copied jmxremote.password.template to jmxremote.password,

3. Then add after tomcat/conf/jmxremote.password:
username password Add
after tomcat/conf/jmxremote.access:
username readwrite

Among them, the user name and password can be modified according to the situation. Then execute: chmod 400 ./jmxremote.password command to modify the permissions of this file, otherwise Error: Password file read access must be restricted: will appear when starting tomcat

4. Download catalina-jmx-remote.jar and go to http://archive Under .apache.org/dist/tomcat/, according to the version of tomcat, find the catalina-jmx-remote.jar file in the bin/extras/ directory, download it, and upload it to the tomcat/lib directory

5. Modify the /etc/hosts file , add the following line, the real IP refers to the IP that can be accessed remotely, usually the public network IP, to ensure that the new hosts take effect (generally automatically take effect, if it does not take effect, you can solve it by yourself)
   real ip localhost

At this point, the server setting is completed

. Start windows The jdk/bin/jvisualvm.exe file, select the remote connection, fill in the remote ip and port, and enter the user name and password for the remote connection (these are all set in the previous server configuration).




Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326947278&siteId=291194637