linux tomcat8 配置 jmx监控

本文详细介绍了如何在Linux上配置Tomcat8以启用JMX监控,包括编辑`catalina.sh`文件,配置`jmxremote.access`和`jmxremote.password`,以及使用jVisualVM进行远程连接验证。通过这些步骤,可以成功实现对Tomcat的JMX监控。
摘要由CSDN通过智能技术生成

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值