Use JDK jconsole to monitor JMX
First, set the monitoring object port configuration Catalina. Sh
# Vi/usr/tomcat/bin/Catalina. Sh
Note:/usr/tomcat/bin/Catalina. Sh is the bin directory of the Tomcat directory (in Linux)
Add content before # OS specific support. $ VaR _ must _ be set to either true or false.
# Java_opts set memory
Java_opts = "-xms2g-xmx2g-XX: + useconcmarksweepgc-XX: + cmsincrementalmode-XX: newsize = 512 M-XX: maxpermsize = 256 m"
# Set JMX port information for catalina_opts
Catalina_opts = "$ catalina_opts-DCOM. Sun. Management. jmxremote-DCOM. Sun. Management. jmxremote. Port = 9004"
Catalina_opts = "$ catalina_opts-DCOM. Sun. Management. jmxremote. SSL = false-DCOM. Sun. Management. jmxremote. Authenticate = false"
Then, start the corresponding Tomcat and view the port running
[[Email protected] ~] # Netstat-antp | grep 9004
TCP 0 0: 9004: * Listen 2288/Java
Finally, verify that the local JDK has been installed.
Open CMD and run the following command to enter the Directory: C: \ Program Files \ Java \ jdk1.6.0 _ 43 \ bin.
C: \ Users \ shuaiqi> Cd/d c: \ Program Files \ Java \ jdk1.6.0 _ 43 \ bin
Execute the jconsole.exe File
C: \ Program Files \ Java \ jdk1.6.0 _ 43 \ bin> jconsole.exe
Now the JMX connection is enabled.
You can select local and remote processes.
Enter the remote address:
Note: you do not need to enter the user and password because the user and password are not required in the above settings. You can set it if necessary.
Monitor JMX memory running on the server