标签:info OLE temp lse long class conf 安全 sed
安装tomcat步骤省略。。。。。。
方法一:开发java监控页面
[root@localhost ~]# mkdir /usr/local/tomcat8/webapps/memtest
[root@localhost ~]# vim /usr/local/tomcat8/webapps/memtest/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>");
%>
[root@localhost ~]# /usr/local/tomcat8/bin/shutdown.sh
[root@localhost ~]# /usr/local/tomcat8/bin/startup.sh
方法二:使用jps命令进行监控
[root@localhost ~]# jps -lvm
19057 sun.tools.jps.Jps -lvm
-Dapplication.home=/usr/local/java -Xms8m 8894 org.apache.catalina.startup.Bootstrap start
-Djava.util.logging.config.file=/usr/local/ tomcat8/conf/logging.properties
-Djava.util.logging.manager=org.apache.juli.ClassLoader LogManager
-Djdk.tls.ephemeralDHKeySize=2048
-Djava.protocol.handler.pkgs=org.apac he.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
方法三:tomcat远程监控
[root@localhost ~]# vim /usr/local/tomcat8/bin/catalina.sh
CATALINA_OPTS="$CATALINA_OPTS
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=12345
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Djava.rmi.server.hostname=192.168.200.111" //后面是本机地址
[root@localhost ~]# /usr/local/tomcat8/bin/shutdown.sh
[root@localhost ~]# /usr/local/tomcat8/bin/startup.sh
在windows下打开/java/bin/jconsole.exe程序
在弹出的窗口中,选择远程进程,输入本机地址和端口号,如下图
点击连接,如下图:
选择不安全的连接就OK了
标签:info OLE temp lse long class conf 安全 sed
原文地址:https://www.cnblogs.com/lyqlyqlyq/p/11641826.html