您的位置:首页 > 运维架构 > Tomcat

tomcat 配置jmx远程监控

2016-08-25 16:26 344 查看
环境:

centOS 7 64位,tomcat 8 ,jdk 1.8

配置tomcat bin 目录下的catalina.sh文件开头添加

-Dcom.sun.management.jmxremote.port=8989

-Dcom.sun.management.jmxremote.authenticate=false

-Dcom.sun.management.jmxremote.ssl=false

-Djava.rmi.server.hostname=139.224.42.51

Dcom.sun.management.jmxremote.port :远程端口号

Dcom.sun.management.jmxremote.authenticate:是否开启用户认证

(这里设置为false,用户认证暂时不弄,以后有时间再做研究)

Dcom.sun.management.jmxremote.ssl:是否要求ssl连接

Djava.rmi.server.hostname:远程服务器ip

JAVA_OPTS="
-Xms512m -Xmx512m -Xss256k
-Dcom.sun.management.jmxremote=true
-Dcom.sun.management.jmxremote.port=8989
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Djava.rmi.server.hostname=139.224.42.51"

cygwin=false
darwin=false
os400=false
hpux=false
case "`uname`" in
CYGWIN*) cygwin=true;;
Darwin*) darwin=true;;
OS400*) os400=true;;
HP-UX*) hpux=true;;
esac

# resolve links - $0 may be a softlink
...


重启tomcat,然后打开jdk bin目录下的jvisualvm.exe,添加远程主机,添加jmx连接,填写对应的端口号即可,如下监控信息:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  tomcat 监控