且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

jconsole监控linux系统的jvm使用

更新时间:2022-07-01 04:16:57

1.在linux系统下载安装jdk和tomcat


2.配置tomcat参数

[root@node3 ~]# vim /usr/local/tomcat-7.0.64Front/bin/catalina.sh 

JAVA_OPTS="$JAVA_OPTS

-Dcom.sun.management.jmxremote     --远程登陆

-Dcom.sun.management.jmxremote.port=9004   -开放端口

-Dcom.sun.management.jmxremote.authenticate=true   --用户密码认证

-Dcom.sun.management.jmxremote.ssl=false        --不启用ssl

-Dcom.sun.management.jmxremote.access.file=/usr/local/jdk1.7.0_80/jre/lib/management/

jmxremote.access      --访问权限

-Dcom.sun.management.jmxremote.password.file=/usr/local/jdk1.7.0_80/jre/lib/management/

jmxremote.password    --访问密码

"

[root@node3 ~]# cd /usr/local/jdk1.7.0_80/jre/lib/management/

[root@node3 management]# cp -a jmxremote.password.template  jmxremote.password

[root@node3 management]# vim jmxremote.password

tingyun  system   --用户名和密码

[root@node3 management]# vim jmxremote.access 

#monitorRole   readonly    --注释

#controlRole   readwrite \

#              create javax.management.monitor.*,javax.management.timer.* \

#              unregister

tingyun readwrite   --用户授权(readonly  只读   readwrite  读写)

[root@node3 management]# chmod  600 jmxremote.password jmxremote.access 

[root@node3 management]# /usr/local/tomcat-7.0.64Front/bin/shutdown.sh 

[root@node3 management]# /usr/local/tomcat-7.0.64Front/bin/startup.sh

[root@node3 management]# netstat -antulp | grep 9004

tcp    0   0 :::9004         :::*          LISTEN      3093/java           

[root@node3 management]# 


3.jconsole连接服务器

jconsole监控linux系统的jvm使用

jconsole监控linux系统的jvm使用










本文转自 z597011036 51CTO博客,原文链接:http://blog.51cto.com/tongcheng/1707194,如需转载请自行联系原作者