首页 技术 正文
技术 2022年11月6日
0 收藏 869 点赞 654 浏览 1291 个字

一、修改要访问的远程主机(Linux)相关文件,本文档只介绍了java-jvisualvm的JMX方式:

1.打开$CATALINA_HOME/bin/startup.sh, 找到倒数第二行(也就是exec “$PRGDIR”/”$EXECUTABLE” start “$@”一行上边)加上如下内容:

export CATALINA_OPTS=”$CATALINA_OPTS-Dcom.sun.management.jmxremote -Djava.rmi.server.hostname=192.168.*.* -Dcom.sun.management.jmxremote.port=7003 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file=/opt/apache-tomcat-6.0.18/conf/jmxremote.password -Dcom.sun.management.jmxremote.access.file=/opt/apache-tomcat-6.0.18/conf/jmxremote.access”

2.备注:

-Dcom.sun.management.jmxremote 启用JMX远程监控
-Djava.rmi.server.hostname=192.168.*.* 连接的服务器地址
-Dcom.sun.management.jmxremote.port=7003 jmx连接端口
-Dcom.sun.management.jmxremote.ssl=false 是否ssl加密
-Dcom.sun.management.jmxremote.authenticate=true 远程连接需要密码认证(如为false后面的可省略);
-Dcom.sun.management.jmxremote.password.file=/opt/apache-tomcat-6.0.18/conf/jmxremote.password 指定连接的用户名和密码配置文件
-Dcom.sun.management.jmxremote.access.file=/opt/apache-tomcat-6.0.18/conf/jmxremote.access 指定连接的用户所拥有权限的配置文件

3.其中jmxremote.password文件:

monitorRole roor123
controlRole root123

4.jmxremote.access文件:

monitorRole readonly
controlRole readwrite

5.重启Tomcat服务。

二、在本地(Windows)创建jvisualvm–JMX连接

1.打开本地安装JDK_HOME/bin目录:C:\Java\jdk1.7.0_80\bin

2.双击:jvisualvm.exe

java-jvisualvm远程监控tomcat

3.右键添加远程主机:

java-jvisualvm远程监控tomcat

4.新建JMX连接

java-jvisualvm远程监控tomcat

5.查看:

java-jvisualvm远程监控tomcat

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,077
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,552
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,400
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,176
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,812
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,894