linux tomcat8 配置 jmx监控
1.编辑tomcat/bin/catalina.sh
找到如下位置
# Uncomment the following line to make the umask available when using the
# org.apache.catalina.security.SecurityListener
#JAVA_OPTS="$JAVA_OPTS -Dorg.apache.catalina.security.SecurityListener.UMASK=`umask`"
# ----- Execute The Requested Command -----------------------------------------
# Bugzilla 37848: only output this if we have a TTY
在Execute The Requested Command前加入如下代码:
CATALINA_OPTS="$CATALINA_OPTS -Djava.rmi.server.hostname=10.12.116.135 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8088 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true"
其中的 hostname换成你本机的ip, port 默认为8088。
2.编辑jmxremote.access和jmxremote.password
进入默认按照的 jdk 目录:
cd /usr/java/jdk1.8.0_45/jre/lib/management
cp jmxremote.password.template jmxremote.password
编辑最后的账户密码,去掉注释,密码改下别用默认的。
# Following are two commented-ou