`
44424742
  • 浏览: 224241 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
文章分类
社区版块
存档分类
最新评论

tomcat设置JMX监控

阅读更多

tomcat设置JMX监控

在正常的系统运行中,经常会有需求需要监控到tomcat运行的各项指标,如此的话,最简单的办法就是打开jmx服务,这样

可以比较方便的获取到tomcat运行的各项参数,甚至可以进行一些服务的关闭,重启等操作。

添加JMX服务监控到tomcat的方法很简单,将catalina.sh/catalina.bat文件中添加下面内容即可,端口号可以自定。
CATALINA_OPTS=-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=1099 \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=false
有些网站上的文章将第一行取消
-Dcom.sun.management.jmxremote
不知道是否合适,如果你看过tomcat官方的帮助文档的话,你就知道虽然那样可以运行,但不是标准的设置。
http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html
上面的简单配置,是不需要密码验证的,jboss这方面不错,直接提供了密码验证的文件,tomcat需要手动添加。
CATALINA_OPTS=-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=1099 \
-Dcom.sun.management.jmxremote.authenticate=true \
-Dcom.sun.management.jmxremote.password.file=../conf/jmxremote.password \
-Dcom.sun.management.jmxremote.access.file=../conf/jmxremote.access \
将验证的选项设置为true之后,就可以设置用户名和密码以及访问权限了。
编辑设置权限的文件 $CATALINA_BASE/conf/jmxremote.access

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics