JVisualVM监视远程主机Tomcat运行情况
来源:互联网 发布:linux内网穿透知乎 编辑:程序博客网 时间:2024/06/15 18:13
因为Tomcat本身是运行在JVM之上,JVisualVM支持监控Java进程的使用情况(如CPU,堆,线程、类等),所以可以使用JVisualVM来监视指定JVM上Tomcat运行情况。JVisualVM支持JMX的方式连接远程,但是需要修改下JAVA_OPTS。连接过程,我们可以配置简单的用户密码校验。会用到的参数包括
-Dcom.sun.management.jmxremote //是否启用JMX
-Dcom.sun.management.jmxremote.port=9899 //连接端口
-Dcom.sun.management.jmxremote.authenticate=true //是否认证
-Dcom.sun.management.jmxremote.ssl=false //是否启用SSL
-Djava.rmi.server.hostname=192.168.1.21 //主机IP
-Dcom.sun.management.jmxremote.password.file=../conf/jmxremote.password //密码文件
-Dcom.sun.management.jmxremote.access.file=../conf/jmxremote.access //用户文件
配置过程如下
[root@centos02 ~] #/usr/local/apache-tomcat-7.0.55/conf
[root@centos02 conf]# vi jmxremote.access
[root@centos02 conf]# vi jmxremote.password
guest readonly
manager readwrite
[root@centos02 conf]# vi jmxremote.password
guest guest
manager manager
CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9899 -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=192.168.1.21 -Dcom.sun.management.jmxremote.password.file=/usr/local/apache-tomcat-7.0.55/conf/jmxremote.password -Dcom.sun.management.jmxremote.access.file=/usr/local/apache-tomcat-7.0.55/conf/jmxremote.access"
[root@centos02 bin]# catalina.sh start
-Dcom.sun.management.jmxremote //是否启用JMX
-Dcom.sun.management.jmxremote.port=9899 //连接端口
-Dcom.sun.management.jmxremote.authenticate=true //是否认证
-Dcom.sun.management.jmxremote.ssl=false //是否启用SSL
-Djava.rmi.server.hostname=192.168.1.21 //主机IP
-Dcom.sun.management.jmxremote.password.file=../conf/jmxremote.password //密码文件
-Dcom.sun.management.jmxremote.access.file=../conf/jmxremote.access //用户文件
配置过程如下
[root@centos02 ~] #/usr/local/apache-tomcat-7.0.55/conf
[root@centos02 conf]# vi jmxremote.access
[root@centos02 conf]# vi jmxremote.password
guest readonly
manager readwrite
[root@centos02 conf]# vi jmxremote.password
guest guest
manager manager
[root@centos02 conf]# cd ../bin
[root@centos02 bin]# vi catalina.shCATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9899 -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=192.168.1.21 -Dcom.sun.management.jmxremote.password.file=/usr/local/apache-tomcat-7.0.55/conf/jmxremote.password -Dcom.sun.management.jmxremote.access.file=/usr/local/apache-tomcat-7.0.55/conf/jmxremote.access"
[root@centos02 conf]# chmod 600 jmx*
[root@centos02 conf]# cd ../bin[root@centos02 bin]# catalina.sh start
配置连接
连接成功后,可以看到运行情况
阅读全文
0 0
- JVisualVM监视远程主机Tomcat运行情况
- 关注程序性能(3) jvisualvm监视远程主机
- Jvisualvm使用JMX和jstatd远程连接主机监测tomcat
- Jvisualvm使用JMX和jstatd远程连接主机监测tomcat
- 通过jvisualvm监控远程java应用的运行情况
- jvisualvm远程监控Tomcat
- jvisualvm远程监控Tomcat
- jvisualvm远程监控Tomcat
- jvisualvm远程监控Tomcat
- jvisualvm远程监控Tomcat
- jvisualvm远程连接tomcat
- jvisualvm远程监控Tomcat
- jvisualvm远程监控Tomcat
- jvisualvm远程监控Tomcat
- jvisualvm远程监控Tomcat
- JVisualVM 远程连接 Tomcat
- jvisualvm远程监控Tomcat
- jvisualvm远程监控Tomcat
- 猜字游戏-合法提示
- 大话数据结构 code 第四章 05顺序队列_Queue
- commons-fileupload 上传中断异常处理
- Oracle 子查询
- 【目录】Ceph专题文章索引
- JVisualVM监视远程主机Tomcat运行情况
- java函数式编程
- Semaphore 信号量 控制进程
- Hyperledger fabric 学习笔记: go语言 与 JSON
- 杭电1696——基础的二分
- java算法之快速排序
- 每日一题(26)—— 无限循环的几种形式
- JSP工作原理
- 《互联网信贷风险与大数据》读书笔记(六)