jmx&tomcat&jvisualvm

tomcat:在catalina.sh或者catalina.bat中 空白位置,增加如下配置
无密码访问
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=12345"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.password=false"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"

有密码访问
# Enabling JMX 
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=12345"
JAVA_OPTS="$JAVA_OPTS 
// 配置在当前目录下的jmxremote.password和jmxremote.access文件
-Dcom.sun.management.jmxremote.password.file=jmxremote.password"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.access.file=jmxremote.access"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"

/etc/tomcat6/jmxremote.password
jmx 123
/etc/tomcat6/jmxremote.access
jmx readonly

授权


<jvm-arg>-Dcom.sun.management.jmxremote</jvm-arg>
<jvm-arg>-Dcom.sun.management.jmxremote.port=12345</jvm-arg>
<jvm-arg>-Dcom.sun.management.jmxremote.ssl=false</jvm-arg>
<jvm-arg>-Dcom.sun.management.jmxremote.password=false</jvm-arg>
<jvm-arg>-Dcom.sun.management.jmxremote.authenticate=false</jvm-arg>
<jvm-arg>-Djava.rmi.server.hostname=192.168.0.31</jvm-arg>


Tomcat_6_JMX_How-To#Enable_JMX_on_Tomcat6

你可能感兴趣的:(xml,sun)