Tomcat enabling JMX Remote

Source: Internet
Author: User
Tags jconsole

Wiki uses JMX for survival monitoring

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} "

For information on how to enabling JMX Remote, refer to the following:

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, 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 are 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 Readonlycontrolrole ReadWrite
  3. Edit the password file $CATALINA _base/conf/jmxremote.password :

    Monitorrole Tomcatcontrolrole Tomcat

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

Note: The JSR Jmx-adaptor opens a second data protocol port. That was a problem when you had installed a local firewall. However, there is at least one possible workaround:using a custom jmxconnectorserver.

Start a JMX Adaptor with fix data port are supported with Tomcat 5.5.25 SRC release:

<Server ...>...< Listener classname= "Org.apache.catalina.mbeans.JMXAdaptorLifecycleListener"            namingport= "8083"  port= "8084"  host= "Myhost" &NBSP;/>&NBSP;&NBSP; </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 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 you mx.authMode="basic" mx.authUser="tomcat" mx.authPassword="strange" can control the access!

  6. A complete list of all Tomcat core MBeans can-find at Http://tomcat.apache.org/tomcat-5.5-doc/catalina/funcspecs/mbean -names.html.


Tomcat enabling JMX Remote

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.