Java VISUALVM for Tomcat performance monitoring

Source: Internet
Author: User
Tags visualvm

    • Java Environment Reference: http://visitor.blog.51cto.com/11247238/1956799

    • Tomcat Deployment Reference: http://visitor.blog.51cto.com/11247238/1956809




    • Download the tomcat version of Catalina-jmx-remote.jar from the official website (this uses Tomcat 7.0.81 version)

Tomcat:http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-7/v7.0.81/bin/apache-tomcat-7.0.81.tar.gz

Jmx:http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-7/v7.0.81/bin/extras/catalina-jmx-remote.jar

Catalina-jmx-remote.jar package is downloaded and placed in Tomcat's Lib directory

[Email protected] lib]# pwd/usr/local/tomcat/lib[[email protected] lib]# wget
    • Add the following in bin/catalina.sh (Windows environment Catalina.bat file)

[Email protected] lib]# cd/usr/local/tomcat/bin/[[email protected] bin]# vim catalina.shcatalina_opts= "$CATALINA _ Opts-dcom.sun.management.jmxremote-dcom.sun.management.jmxremote.port=7090-dcom.sun.management.jmxremote.ssl= False-djava.rmi.server.hostname=192.168.100.1-dcom.sun.management.jmxremote.authenticate=true-dcom.sun.manage Ment.jmxremote.password.file=/usr/local/softinstall/tomcat/conf/jmxremote.password- Dcom.sun.management.jmxremote.access.file=/usr/local/softinstall/tomcat/conf/jmxremote.access "


    • Edit Access Authorization File

[[email protected] lib]# cd/usr/local/tomcat/conf/[[email protected] conf]# vim Jmxremote.access[[email protected] conf ]# Cat Jmxremote.accessmonitorrole Readonlycontrolrole ReadWrite
    • Edit Password file

[Email protected] conf]# vim Jmxremote.password [[email protected] conf]# cat Jmxremote.passwordmonitorrole Tomcatcontrolrole Tomcat

Note: The password file should be read-only and can only be run by Tomcat.

Change Password file permissions, otherwise report the following error:

Error:password file read access must be restricted:/usr/local/tomcat/conf/jmxremote.password

[[email protected] conf]# chmod 0400 jmxremote.password[[email protected] conf]# ll jmxremote.password-r--------1 root R Oot 15:47 Jmxremote.password
    • Start Tomcat

[[email protected] conf]# .. /bin/startup.sh using catalina_base:   /usr/local/softinstall/tomcatusing  catalina_home:   /usr/local/softinstall/tomcatusing catalina_tmpdir: /usr/local/ softinstall/tomcat/tempusing jre_home:        /usr/local/ softinstall/jdk1.7.0_79using classpath:       /usr/local/softinstall/ Tomcat/bin/bootstrap.jar:/usr/local/softinstall/tomcat/bin/tomcat-juli.jartomcat started. [[email protected] conf]# netstat -nlput | grep javatcp         0      0 :::7090                      :::*                          listen      7329/java                      tcp         0      0 ::ffff:127.0.0.1:7005        :::*                          LISTEN       7329/java                     tcp        0       0 :::7080                      :::*                 &nbsP;        listen      7329/java[[email  protected] conf]# curl -I localhost:7080HTTP/1.1 200 OKServer:  Apache-coyote/1.1content-type: text/html;charset=iso-8859-1transfer-encoding: chunkeddate: fri,  25 aug 2017 08:58:54 gmt

Tomcat started successfully, JMX7090 Port started successfully

    • Deploying the Java environment on a Windows server

Locate Jvisualvm.exe (another tool for Jconsole.exe is also in the Bin directory, where the JVISUALVM tool is used) in the installation directory bin directory of the JDK

C:\Program Files\java\jdk1.8.0_131\bin

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M00/A2/78/wKioL1mf6Z2ytYrJAADC2ohbj4s480.jpg-wh_500x0-wm_ 3-wmp_4-s_1314896248.jpg "title=" 80.jpg "alt=" Wkiol1mf6z2ytyrjaadc2ohbj4s480.jpg-wh_50 "/>

Double-click Run Jvisualvm.exe

650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M02/03/C7/wKiom1mf6jKDPtdAAAAbGcLCins603.jpg-wh_500x0-wm_ 3-wmp_4-s_706599865.jpg "title=" 81.jpg "alt=" Wkiom1mf6jkdptdaaaabgclcins603.jpg-wh_50 "/>

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M00/A2/78/wKioL1mf6nDjKr-WAACnbAiX7lY771.jpg-wh_500x0-wm_ 3-wmp_4-s_2145157048.jpg "title=" 82.jpg "alt=" Wkiol1mf6ndjkr-waacnbaix7ly771.jpg-wh_50 "/>

Click--Remote--Add remote host--fill in the pop-up window with the name of the remote host--Click OK

650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M00/03/C7/wKiom1mf6v-Qqv09AACgpNLyihM519.jpg-wh_500x0-wm_ 3-wmp_4-s_1983075860.jpg "title=" 83.jpg "alt=" Wkiom1mf6v-qqv09aacgpnlyihm519.jpg-wh_50 "/>


650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M00/A2/78/wKioL1mf63GigLO6AAAiwF6i5Dk147.jpg-wh_500x0-wm_ 3-wmp_4-s_2837475768.jpg "title=" 84.jpg "alt=" Wkiol1mf63giglo6aaaiwf6i5dk147.jpg-wh_50 "/>


Application--Remote--Select a host to add between--right-click-Add JMX Connection--fill in the popup window with the connection information--OK


650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M00/A2/78/wKioL1mf7KLB99viAADIPT6-AkI267.jpg-wh_500x0-wm_ 3-wmp_4-s_1336561194.jpg "title=" 87.jpg "alt=" Wkiol1mf7klb99viaadipt6-aki267.jpg-wh_50 "/>

650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/03/C8/wKiom1mf7czTo1dTAADn3he54T4836.jpg-wh_500x0-wm_ 3-wmp_4-s_1926640504.jpg "title=" 90.jpg "alt=" Wkiom1mf7czto1dtaadn3he54t4836.jpg-wh_50 "/>

Connection Successful

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M02/A2/78/wKioL1mf7s7zlupPAAEFW0ySp_g323.jpg-wh_500x0-wm_ 3-wmp_4-s_1965713883.jpg "title=" 92.jpg "alt=" Wkiol1mf7s7zluppaaefw0ysp_g323.jpg-wh_50 "/>



This article is from the "Ten Miles Breeze" blog, please be sure to keep this source http://visitor.blog.51cto.com/11247238/1959387

Java VISUALVM for Tomcat performance 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.