Druid monitoring the number of connections per service database and SQL execution efficiency

Source: Internet
Author: User

1. Download Druid

2. Put the druid you just downloaded into the Lib directory under Tomcat

3. Configure the service startup file to be monitored, add:-djava.net.preferipv4stack=true-dcom.sun.management.jmxremote- dcom.sun.management.jmxremote.port=4090-dcom.sun.management.jmxremote.rmi.port=4090- Dcom.sun.management.jmxremote.ssl=false-dcom.sun.management.jmxremote.authenticate=false- djava.rmi.server.hostname=192.168.9.135

The IP and port are changed according to the actual situation and the service is restarted after the addition.

Such as:

4. Modify the Webapps/root/web-inf/web.xml file under Tomcat and add it to the Web-app tag:

<!--driud monitoring--><servlet><servlet-name>druidstatview</servlet-name><servlet-class>com.alibaba.druid.support.http.statviewservlet</servlet-class><!--Remote Access Javase project using JMX connection--><init-param><param-name>jmxurl</param-name>< Param-value>service:jmx:rmi:///Jndi/rmi://192.168.9.135:4090/jmxrmi</param-value></init-param><init-param><param-name>loginUsername</param-name><param-value> Admin</param-value></init-param><init-param><param-name>loginpassword</param-name ><param-value>admin</param-value></init-param></servlet><servlet-mapping>< Servlet-name>druidstatview</servlet-name><url-pattern>/druid/*</url-pattern></servlet-mapping>

Restart Tomcat when you are finished adding.

5, browser access to Tomcat address, such as: http://192.168.1.131:8081/druid/login.html, Default user name: admin Password: admin

6, data source monitoring situation

7, SQL monitoring situation

Druid monitoring the number of connections per service database and SQL execution efficiency

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.