wiki 利用JMX做存活监控

cat /opt/wiki/work/bin/setenv.sh | grep jmxremote
CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8410 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Duser.timezone=Asia/Shanghai ${CATALINA_OPTS}"

关于如何Enabling JMX Remote,参考如下:

http://tomcat.apache.org/tomcat-5.5-doc/monitoring.html#Enabling_JMX_Remote

The Sun website includes the list of options and how to configure JMX Remote on Java 5:http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html.

For quick installation you find here a short installation guide:

Add the following parameters to your Tomcat startup script:

    set CATALINA_OPTS=-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=%my.jmx.port% \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=false
  1. When you think authorization is a good, add and change this :

        -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. edit the access allow file $CATALINA_BASE/conf/jmxremote.access :
    monitorRole readonly
    controlRole readwrite
  3. edit the password file $CATALINA_BASE/conf/jmxremote.password :
    monitorRole tomcat
    controlRole tomcat

    Tip: Password File must be readonly and not accessible from every other user! Remove all other users under windows to access this file.

Note:The JSR 160 JMX-Adaptor opens a second data protocol port. That is a problem when you have installed a local firewall. However, there is at least one possible workaround: using a custom JMXConnectorServer.

Start a JMX Adaptor with fix data port is supported with Tomcat 5.5.25 src release:

<Server ...>
...
<Listener className="org.apache.catalina.mbeans.JMXAdaptorLifecycleListener"
namingPort="8083" port="8084" host="myhost" />
...
</Server>

You can use all JMX system properties (com.sun.management.jmxremote.xxx) to configure the adaptor :-) 
At your remote jconsole call the jmx adaptor with following command 
jconsole service:jmx:rmi://myhost:8084/jndi/rmi://myhost:8083/server

Activate JMX MX4J Http Adaptor with Java 1.4:

  1. Install the tomcat compat package
  2. Install the mx4j-tools.jar at common/lib. Please, use the same MX4j version as your Tomcat release
  3. Configure a MX4J JMX HTTP Adaptor at your AJP Connector
          <Connector port="${AJP.PORT}"
    handler.list="mx"
    mx.enabled="true"
    mx.httpHost="${JMX.HOST}"
    mx.httpPort="${JMX.PORT}"
    protocol="AJP/1.3" />

    Tip: With ${AJP.PORT}=0 no ajp connection where started.

    Note: MX4J JSR 160 RMI Adaptor to support JDK 1.4 currently not integrated.

  4. Start your Tomcat and look with a browser at http://${JMX.HOST}:${JMX.PORT}
  5. With the mx connector parameter mx.authMode="basic" mx.authUser="tomcat" mx.authPassword="strange" you can control the access!
  6. A complete list of all Tomcat core MBeans can you find at http://tomcat.apache.org/tomcat-5.5-doc/catalina/funcspecs/mbean-names.html.

tomcat Enabling JMX Remote的更多相关文章

  1. connect to tomcat with JMX

    Answering my own question; turned out to be easier than i thought. Following needs to be done, for e ...

  2. Tomcat配置JMX远程监控(Windown7 Linxu)

    一:Window7下配置方式. 1.配置catalina.bat 在第一行加入下面配置 注意下面这些配置要在一行,注意包含空格. set JAVA_OPTS=-Dcom.sun.management. ...

  3. Tomcat开启JMX监控

    搭建模拟环境: 操作系统:centos7内存:1Gjdk:1.8.0_131tomcat:8.0.48 环境准备我们这里就不直接演示了,直接配置tomcat的jmx 1.进入到tomcat的bin目录 ...

  4. Tomcat 打开jmx

    jmx 配置后可以通过windows java客户端自带的jconsole.exe配置登陆,直观的查看jvm的情况及系统的各项指标: 一.配置linux下tomcat的jmx 具体配置如下,如果生产环 ...

  5. Tomcat开启JMX监控 visualvm

    Tomcat开启JMX监控 https://blog.csdn.net/dongdong2980/article/details/78476393

  6. tomcat配置JMX

    最近看JDK的命令行工具,使用Java VisualVM和Jconsole工具都可以监控java程序的运行情况(包括CUP和内存等的使用情况,线程的运行状态等) 在Java VisualVM 工具里可 ...

  7. zabbix监控tomcat(使用jmx监控,但不使用系统自带模版)

    一,zabbx使用jmx监控tomcat的原理分析 1.Zabbix-Server找Zabbix-Java-Gateway获取Java数据 2.Zabbix-Java-Gateway找Java程序(j ...

  8. 排障利器之远程调试与监控 --jmx & remote debug

    监控和调试功能是应用必备的属性之一,其手段也是多种多样. 一般地,我们可以通过:线上日志, zabbix, grafana, cat 等待系统做一问题留底,有问题及时报警,从而达到监控效果. 而对于应 ...

  9. linux 下idea 启动tomcat报JMX 1099错误解决办法

    开始使用linux开发环境,在配置idea 下tomcat 启动时报错,提示错误为unable to ping server at localhost:1099. 解决办法: 修改/etc/hosts ...

随机推荐

  1. Hbase 操作工具类

    依赖jar <dependency> <groupId>org.apache.hbase</groupId> <artifactId>hbase-cli ...

  2. PSNR

    PSNR,峰值信噪比,通常用来评价一幅图像压缩后和原图像相比质量的好坏,当然,压缩后图像一定会比原图像质量差的,所以就用这样一个评价指标来规定标准了.PSNR越高,压缩后失真越小.这里主要定义了两个值 ...

  3. cocos2dx for iOS fmod的音效引擎接入

    上一个博客我写了一篇fmod的android接入过程,这一次介绍一下ios接入fmod的方法. 首先下载fmod的api包,解压后,在FMOD Programmers API/api文件夹下有lowl ...

  4. 括号匹配性检测C语言实现

    #include <stdio.h> #define SIMPLE_KUOHAO "(()1231qeqw)(@#$)" #define COMPLEX_KUOHAO ...

  5. js函数节流和函数防抖

    概念解释 函数节流: 频繁触发,但只在特定的时间内才执行一次代码 函数防抖: 频繁触发,但只在特定的时间内没有触发执行条件才执行一次代码 函数节流 函数节流应用的实际场景,多数在监听页面元素滚动事件的 ...

  6. GoogleTest 之路3-Mocking Framework

    当你写一个原型或者测试的时候,依赖整个object 是不可行和明智的.一个 mock object和 real object 有同样的接口(所以它可以像同一个使用),但是让你在运行时进行指定它应该如何 ...

  7. http客户端与浏览器的区别

    两者区别:浏览器对http响应头会进行特定处理(如自动读取本地缓存.设置cookie等),而http客户端(如crul)可能没有像浏览器那样的处理,某些封装程度高的http客户端,可能会有. 同一个文 ...

  8. python-类与继承

    类的继承 什么是继承? 继承是一种新建类的方式,新建的类称为子类,被继承的类称为父类.python中,父类.子类(派生类)只有在继承的时候才会产生. 继承的特性:子类会继承父类所有的属性. 为什么要用 ...

  9. LeetCode(172)Factorial Trailing Zeroes

    题目 Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in ...

  10. 在spring boot中使用webSocket组件(二)

    该篇演示如何使用websocket创建一对一的聊天室,废话不多说,我们马上开始! 一.首先先创建前端页面,代码如下图所示: 1.login.html <!DOCTYPE html> < ...