D:\apache-tomcat-7.0.57\bin\catalina.bat
set CATALINA_OPTS=-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8899 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file=../conf/jmxremote.password -Dcom.sun.management.jmxremote.access.file=../conf/jmxremote.access
D:\apache-tomcat-7.0.57\conf\jmxremote.access
# Default access control entries: # o The "monitorRole" role has readonly access. # o The "controlRole" role has readwrite access and can create the standard # Timer and Monitor MBeans defined by the JMX API. monitorRole readonly controlRole readwrite \ create javax.management.monitor.*,javax.management.timer.* \ unregister
D:\apache-tomcat-7.0.57\conf\jmxremote.password
# In a typical installation, this file can be read by anybody on the
# local machine, and possibly by people on other machines.
# For # security, you should either restrict the access to this file,
# or specify another, less accessible file in the management config file
# as described above.
#
# Following are two commented-out entries. The "measureRole" role has
# password "QED". The "controlRole" role has password "R&D".
monitorRole tomcat
controlRole tomcat
启动Tomcat后,运行如下命令,检测配置效果(注意实际配置的端口号可能不同):
netstat -an | find "8899"
参考文章:
中文
http://blog.csdn.net/caolaosanahnu/article/details/7617211
http://blog.csdn.net/airobot008/article/details/3951524
StackOverflow
http://stackoverflow.com/questions/516142/does-java-6-open-a-default-port-for-jmx-remote-connections
Oracle官网及博客
https://docs.oracle.com/cd/E19340-01/820-6740/ggvud/index.html
https://docs.oracle.com/javase/7/docs/technotes/guides/management/agent.html
https://blogs.oracle.com/jmxetc/entry/connecting_through_firewall_using_jmx
原文:http://www.cnblogs.com/rgqancy/p/6364302.html