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 |
|
|
|
|
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 \ |
|
|
|
|
Edit the access allow file $CATALINA _base/conf/jmxremote.access :
|
|
|
|
Monitorrole Readonlycontrolrole ReadWrite |
|
|
|
|
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:
Install the Tomcat Compat package
Install the Mx4j-tools.jar at Common/lib. Please, use the same mx4j version as your Tomcat release
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.
Start your Tomcat and look with a browser at HTTP://${JMX. Host}:${jmx. PORT}
With the MX connector parameter you mx.authMode="basic" mx.authUser="tomcat" mx.authPassword="strange"
can control the access!
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