1. In the last row of $ catalina_home/bin/startup. Sh (that isExec "$ prgdir"/"$ executable" start "[email protected]"Line above) Add the following content:
Export catalina_opts ="$ CATALINA_OPTS-Dcom.sun.management.jmxremote-djava. RMI. server. hostname = 192.168.1.130-DCOM. sun. management. jmxremote. port = 7003-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"
The parameters are described as follows:
-DCOM. Sun. Management. jmxremote enables JMX Remote Monitoring-Djava. RMI. server. hostname =192.168.1.130This is the address connecting your Tomcat server-DCOM. Sun. Management. jmxremote. Port =7003JMX connection Port-DCOM. Sun. Management. jmxremote. SSL =FalseSSL encryption?-DCOM. Sun. Management. jmxremote. Authenticate =TruePassword authentication is required for remote connection.-DCOM. Sun. Management. jmxremote. Password. File = ../CONF/Jmxremote. Password specifies the connection user name and password configuration file-DCOM. Sun. Management. jmxremote. Access. File = ../CONF/jmxremote. Access specifies the configuration file with the permission of the connected user.
2. In $ catalina_home/lib/jmxremote. Access, add the user name and permissions for connection monitoring:
MonitorroleReadonlyControlrole readwrite
3. Add the username and password for connection monitoring in $ catalina_home/lib/jmxremote. Password. the user's permissions are in jmxremote. Access and configured:
Monitorrole111111Controlrole222222
4. modify the permissions of jmxremote. Access and jmxremote. Password:
Sudo chmod600JMX *
5. Restart tomcat.
6. Open jvisualvm.exe under $ java_home/bin, as shown in the following figure:
7. Right-click on the remote server, add the host, and enter the IP address of the server:
8. Right-click on the remote host and add a JMX connection. My port number is 7003. OK:
9. This will prompt you to enter the user name and password, that is, the user name and password you set in jmxremote. Password:
10. Enter the correct user name and password, and click the link to open the connection. The following figure is displayed:
you can view the server resources and tomcat threads.