下载地址:
wget http://mirrors.cnnic.cn/apache/tomcat/tomcat-8/v8.5.8/bin/extras/catalina-jmx-remote.jar #下载catalina-jmx-remote.jarmv catalina-jmx-remote.jar /apache/tomcat/apache-tomcat-8.5.8/libvi /apache/tomcat/apache-tomcat-8.5.8/conf/server.xml #内容见server.xmlvi /apache/tomcat/apache-tomcat-8.5.8/conf/jmxremote.accessvi /apache/tomcat/apache-tomcat-8.5.8/conf/jmxremote.passwordvi /apache/tomcat/apache-tomcat-8.5.8/bin/setenv.sh #内容见setenv.shfirewall-cmd --add-port=10001/tcp --permanent firewall-cmd --add-port=10002/tcp --permanent firewall-cmd --reload #重新加载stemctl restart tomcat
server.xml
#在此节点下添加以下节点
jmxremote.access
admin readwrite
jmxremote.password
admin admin
setenv.sh
#add tomcat pidCATALINA_PID="$CATALINA_BASE/tomcat.pid"#add java optsJAVA_OPTS="-server -XX:PermSize=256M -XX:MaxPermSize=1024m -Xms512M -Xmx1024M -XX:MaxNewSize=256m -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.password.file=/apache/tomcat/apache-tomcat-8.5.8/conf/jmxremote.password -Dcom.sun.management.jmxremote.access.file=/apache/tomcat/apache-tomcat-8.5.8/conf/jmxremote.access -Djava.rmi.server.hostname=192.168.152.130"
使用visualVM添加jvx连接,如下图
输入ip,端口号,用户名密码,并且不使用ssl
如下图,成功配置