zoukankan      html  css  js  c++  java
  • jvisualvm远程监控tomcat

    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.1.130
    -Dcom.sun.management.jmxremote.port=7003
    -Dcom.sun.management.jmxremote.ssl=false
    -Dcom.sun.management.jmxremote.authenticate=true
    -Dcom.sun.management.jmxremote.password.file=../conf/jmxremote.password
    -Dcom.sun.management.jmxremote.access.file=../conf/jmxremote.access"
    

      

    -Dcom.sun.management.jmxremote 启用JMX远程监控
    -Djava.rmi.server.hostname=192.168.1.130  这是连接你的tomcat服务器地址
    -Dcom.sun.management.jmxremote.port=7003  jmx连接端口
    -Dcom.sun.management.jmxremote.ssl=false  是否ssl加密
    -Dcom.sun.management.jmxremote.authenticate=true  远程连接需要密码认证
    -Dcom.sun.management.jmxremote.password.file=../conf/jmxremote.password  指定连接的用户名和密码配置文件
    -Dcom.sun.management.jmxremote.access.file=../conf/jmxremote.access  指定连接的用户所拥有权限的配置文件
    

      2、在$CATALINA_HOME/conf/jmxremote.access里添加可以连接监控的用户名以及权限:

    monitorRole readonly
    controlRole readwrite
    

      3、在$CATALINA_HOME/conf/jmxremote.password 里添加可以连接监控的用户名以及密码,用户的权限在jmxremote.access里以及配置了:

    monitorRole  111111
    controlRole   222222
    

      4、修改jmxremote.access和jmxremote.password的权限:

    sudo chmod 600 jmx*
    

      5、重启tomcat就可以了

    转自https://www.cnblogs.com/leocook/p/jvisualvmandtomcat.html

  • 相关阅读:
    Asp.Net 构架(Http Handler 介绍) Part.2<转>
    大数据插入<转>
    网站开发技巧参考大全<转>
    qq校友好东西
    SQL2005存储过程解密 <转>
    用Lucene.net对数据库建立索引及搜索<转>
    用SharpDevelop3调试ASP.NET的方法
    【转】卢彦的利用xml实现通用web报表打印
    张仰彪第二排序法 <转>
    依赖注入那些事儿 <转>
  • 原文地址:https://www.cnblogs.com/nunuAction/p/8297454.html
Copyright © 2011-2022 走看看