Windows under Tomcat add JMX monitoring

Source: Internet
Author: User

Take TOMCAT7 as an example:

1. Tomcat launched as a Windows service, double-click the Tomcat installation directory under Tomcat7w.exe, and under Java-java options, add configuration parameters:

-dcom.sun.management.jmxremote
-dcom.sun.management.jmxremote.port=9000
-dcom.sun.management.jmxremote.ssl=false
-dcom.sun.management.jmxremote.authenticate=false

To start the Tomcat service, you can use the Jconsole.exe or Jvisualvm.exe in the Jdk/bin directory to add JMX Connection 9000 ports to observe the Tomcat run status information.

Note: There are no spaces after the preceding few lines, because there are spaces after 9000, and you will be prompted when you start Tomcat: "Error: Com.sun.management.jmxremote.port number is invalid: 9000"

2. Tomcat launched with the Startup.bat script can be configured directly in the Catalina.bat file

Set java_opts=%java_opts%-dcom.sun.management.jmxremote-dcom.sun.management.jmxremote.port=9000- Dcom.sun.management.jmxremote.ssl=false-dcom.sun.management.jmxremote.authenticate=false

Other, same as service startup mode.

3. When you install Tomcat as a Windows service, you can modify the parameters in the Service.bat so that the default parameters are set after the service is successfully installed without having to modify the Tomcat7w.exe again.

Modify the location at the end of the Service.bat file, such as:

REM Set extra parameters "%executable%"//us//%service_name%--jvmoptions "-dcatalina.base=%catalina_base%;-d catalina.home=%catalina_home%;-djava.endorsed.dirs=%catalina_home%\endorsed "--StartMode JVM--StopMode jvmrem More Extra Parametersset "Pr_logpath=%catalina_base%\logs" set Pr_stdoutput=autoset pr_stderror=auto "%EXECUTABLE%"//US// %service_name% ++jvmoptions "-djava.io.tmpdir=%catalina_base%\temp;-djava.util.logging.manager= Org.apache.juli.classloaderlogmanager;-djava.util.logging.config.file=%catalina_base%\conf\logging.properties; -xx:permsize=256m;-xx:maxpermsize=512m;-dcom.sun.management.jmxremote;-dcom.sun.management.jmxremote.port=9000 ;-dcom.sun.management.jmxremote.ssl=false;-dcom.sun.management.jmxremote.authenticate=false "--JvmMs--JvmMx 1024echo the service '%service_name% ' has been installed.

Windows under Tomcat add JMX monitoring

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.