Tomcat monitoring and management

Tomcat monitoring and management

===================
Method One: Develop Java monitoring page

[root@localhost ~]# vim /usr/local/tomcat8/webapps/meminfo/meminfo.jsp
<%
Runtime rtm = Runtime.getRuntime();
long mm = rtm.maxMemory()/1024/1024;
long tm = rtm.totalMemory()/1024/1024;
long fm = rtm.freeMemory()/1024/1024;
out.println("JVM memory detail info :<br>");
out.println("Max memory:"+mm+"MB"+"<br>");
out.println("Total memory:"+tm+"MB"+"<br>");
out.println("Free memory:"+fm+"MB"+"<br>");
out.println("Available memory can be used is :"+(mm+fm-tm)+"MB"+"<br>");
%>
保存退出
Access 192.168.200.67:8080/meminfo/meminfo.jsp in your browser

 

·················································· ·····················
method two: use jsp command to monitor the
upload jdk installed in order to use jsp -lvm command (jdk-8u191-linux-x64.tar.gz )
[the root @ localhost ~] # RM -rf / usr / bin / Java
[the root @ localhost ~] # JDK the tar-XF-Linux-8u191 x64.tar.gz
[the root @ localhost ~] # Music Videos jdk1.8.0_191 / / usr / local / Java
[the root @ localhost ~] # Vim / etc / Profile
[the root @ localhost ~] -i # Sed '$ aexport the JAVA_HOME = / usr / local / Java \ nexport the PATH the PATH = $: $ the JAVA_HOME / bin '/ etc / Profile
[the root @ localhost ~] # Source / etc / Profile
[the root @ localhost ~] # -version Java
Java Version "1.8.0_191"
the Java ((TM)) the Runtime Environment SE (Build 1.8.0_191-B12)
the Java the HotSpot ((TM)) 64-Bit the VM Server (Build-B12 25.191, Mixed MODE)
[the root @ localhost ~] # JPS -lvm
2021 org.apache.catalina.startup.Bootstrap start -Djava.util.logging.config.file = / usr / local / tomcat8 / conf / logging.properties -Djava.util.logging.manager = org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize = 2048 -Djava.protocol.handler.pkgs = org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK = 0027 -Dignore.endorsed.dirs = -Dcatalina.base = / usr / local / tomcat8 -Dcatalina.home = / usr / local / tomcat8 -Djava.io.tmpdir = / usr / local / tomcat8 / TEMP
2764 sun.tools.jps.Jps -lvm -Dapplication.home = / usr / local / the Java -Xms8m
············································· ······························
method three: open the tomcat remote monitoring function (very important)
to modify the configuration file, open the remote monitoring
[ ~ @ localhost root] # vim /usr/local/tomcat8/bin/catalina.sh
  2 CATALINA_OPTS = "$ CATALINA_OPTS
  -Dcom.sun.management.jmxremote. 3
  . 4 = 12345 -Dcom.sun.management.jmxremote.port port number # 12345
  . 5 -Dcom.sun.management.jmxremote.authenticate = false // closed when verification
  6 -Dcom.sun # = flase .management.jmxremote.ssl
  7 -Djava.rmi.server.hostname = 192.168.200.67 "
save and exit
[root @ localhost ~] # /usr/local/tomcat8/bin/shutdown.sh
[root @ localhost ~] /usr/local/tomcat8/bin/startup.sh #
[root @ localhost ~] # netstat -lnpt // Watch 12345 port
tcp6 0 0 ::: 12345 ::: * LISTEN 4161 / the Java          
tcp6 0 0 ::: 8080 ::: * LISTEN 4161 / java       
jdk installed in Windows, click /bin/jconsole.exe monitoring information for viewing CPU usage, memory usage, etc. stack

jconsole.exe This is a monitoring software    

Note windows need to install jdk environment!
Download: http: //www.oracle.com/techneteork/java/javase/downloads/index.html

In the end of the installation package jdk deb system is ubuntu
tomcat Download: tomcat.apache.org Source Select core represents
mysql Download: mysql.com/downloads/
command: md5sum sequence number to detect the installation package installation package, and see official website are the same, indicating that there is no middleman been tampered with.

 

 

 

 

 

 

 End ~~~

~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 

Guess you like

Origin www.cnblogs.com/elin989898/p/11921389.html