Use the Jconsole tool to monitor Java performance

Source: Internet
Author: User

Reference:http://blog.163.com/lucas_nina/blog/static/185960149201493034258448/Proven OK Jconsole is a tool that comes with the JDK. So install the JDK first 

Path to the 1.jconsole tool:

View/usr/local/jdk1.7.0_79/bin/jconsole by which Jconsole2. How to use:On the Linux monitor side of the graphical interface execution:/usr/local/jdk1.7.0_79/bin/jconsoleA graphical Java monitoring and Management console appears.3. After execution appears jconsole new connection, there are two options:1. Local process (can monitor native Java)--"Org.apache.catalina.startup.Bootstartup start"2. Remote process (Java for monitoring other hosts)---"fill in the host name that needs to be monitored: monitoring port, enter the monitoring dedicated username/password (optional)Step 1: Modify the catalina.sh configuration file on the monitored Host:vi/opt/tomcat/conf/catalina.shIf you do not require password verification, add the following 3 lines at the beginning of the second line:java_opts= "$JAVA _opts-dcom.sun.management.jmxremote.port=12345"Java_opts=" $JAVA _opts-dcom.sun.management.jmxremote.authenticate=false"Java_opts=" $JAVA _opts-dcom.sun.management.jmxremote.ssl=false"Save exit//"12345" for monitoring port number for password verification, the following 4 lines will be changed:java_opts= "$JAVA _opts-dcom.sun.management.jmxremote.port=12345"Java_opts=" $JAVA _opts-dcom.sun.management.jmxremote.authenticate=true"Java_opts=" $JAVA _opts-dcom.sun.management.jmxremote.ssl=false"Java_opts=" $JAVA _opts-dcom.sun.management.jmxremote.pwd.file=/usr/local/jdk1.7.0_79/Jre/lib/management/jmxremote.password "Save exitStep 2: Copy the/usr/local/jdk1.7.0_79/jre/lib/management/jmxremote.password.template:Cp/usr/local/jdk1.7.0_79/jre/lib/management/jmxremote.password.template \/usr/local/jdk1.7.0_79/jre/lib/ Management/jmxremote.passwordStep 3: Add the user name and password for remote monitoring:VIJmxremote.password//To add a user name and passwordMonitorrole 12345678//Username: monitorrole, this name system is pre-setAdmin 123456//Custom user name: adminRoot 123456//Custom user name: RootForce Save exitVIjmxremote.access//custom monitored User name has what permissionsAdd to:Admin ReadOnly//define read-only account, name anyroot readwrite \//define read/write account, name anyCreate javax.management.monitor.*,javax.management.timer.* \Save ExitchmodJmxremote.passwordChown UUCP:UUCP Jmxremote.password//First use ls-l/usr/local/jdk1.7.0_79 to see which users and groups belong to, and then set to the same.  Note: If Jconsole cannot access native programs, add the following: java_opts= "$JAVA _opts-dcom.sun.management.jmxremote"OK, you can connect:Enter the host name to be monitored Cen01, port: 12345,

Use the Jconsole tool to monitor Java performance

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.