MySQL Advanced learning Note 16: MySQL Monitor! (Video serial Number: Advanced _35)

Source: Internet
Author: User

Tag: Database observation div database LIS Check innodb admin monitor MySQL

Knowledge Point 16: MySQL monitoring (+)first, why use MySQL monitoring

With the continuous upgrading of software, the number of Myssql servers is more and more, and the probability of hardware and software failure is getting higher. This time need a set of monitoring system, when the host abnormal, at this time through the monitoring system discovery and processing.

This monitoring is actually after our development is completed, this time the software is running, this run we need to focus on the MySQL server is normal, then we need to observe it to provide some monitoring, this monitoring is when it fails,

Then our monitoring will tell us exactly where some of the anomalies or errors have occurred, and we can deal with them at this time.

second, the common classification of monitoring methods1. Write your own program or script control

More for the database is not much or the database itself is relatively small, then we can use this way.

steps:

1, monitor MySQL to provide normal service

- - -Hlocalhost Ping

If the result output: Mysqld is alive

2. Get several current status values for MySQL

- - -hlocalhost status

3. Get the current connection information for the database

- - -Hlocalhost processlist

4. Get the number of connections for the current database          

- - - BNe "Select Host,countfromgroup by host;" Information_schema

5. Check, repair, analyze, optimize the related tables in MySQLServer

- - -- all-databases
on the MySQL connection client, execute the following command

1. Used to monitor whether MySQL uses temporary tables too much, if a temporary table is too large to be swapped out of memory to the disk file:

 like ' created_tmp% ';  

        2. Lock status: Lock status including table and row locks, we can get the total number of locks through the system state variables, the number of times the lock causes other threads to wait, and lock the wait time information

 like ' %lock% '

        3.innodb_log_waits state variable directly reflects the number of waits due to insufficient Innodb log Buffer space

 like ' innodb_log_waits ';  

MySQL Advanced learning Note 16: MySQL Monitor! (Video serial Number: Advanced _35)

Related Article

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.