需要在启动参数中配置如下信息:
-Djava.rmi.server.hostname=192.168.1.107 -Dcom.sun.management.jmxremote.port=18888 -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.managementote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -XX:+UnlockCommercialFeatures -XX:+FlightRecorder
其中比较重要的两个参数是:
# 对外提供服务的IP地址,也就是 tomcat 部署的服务器地址
-Djava.rmi.server.hostname=192.168.1.107
-Dcom.sun.management.jmxremote.port=18888
tomcat 主要在 catalina.sh 脚本中进行配置