A very useful and powerful tool---percona-toolkit

         1. Introduction to percona-toolkit

percona-toolkit is a collection of advanced command line tools, mainly used to perform various mysql and system tasks that are very complicated and troublesome to perform manually, these tasks include:

1) Check the consistency of master and slave data

2) Efficiently archive records

3) Find duplicate indexes

4) Summarize server information

5) Analyze queries from logs and tcpdump

6) Collect important system information when the system fails

percona-toolkit is derived from Maatkit and Aspersa tools. These two tools are the most famous tools for managing mysql. Since Maatkit tools are no longer maintained, please use percona-toolkit! These tools mainly include development, performance, configuration, monitoring, replication, system, utility, etc. As an excellent DBA, some tools are very useful. If they can be mastered and applied flexibly, work efficiency will be greatly improved.

Second, the percona-toolkit tool installation process

1. Download the software package

First go to the official website https://www.percona.com/software/mysql-tools/percona-toolkit to find the corresponding version and download the latest version download link: https://www.percona.com/downloads/percona-toolkit/ 2.2.14/deb/percona-toolkit_2.2.14.tar.gz

Or via linux command wget https://www.percona.com/downloads/percona-toolkit/2.2.14/deb/percona-toolkit_2.2.14.tar.gz

2. Installation of software packages

1) First, you need to install several auxiliary software before installation

 


 

 

2) After that, you can install percona-toolkit

First unzip the archive

 


 

 

Then execute Makefile.PL through perl

 


 

Then find that DBD and DBI do not exist and then perform yum to install DBD and DBI

After yum is installed, run perl again to execute Makefile.PL


 

 

Then start compiling and installing


 

 


 

 

So far the installation has been completed

Third, the percona-toolkit tool is easy to use

First introduce a simple and very useful function to modify the table structure online using pt-online-schema-change

Here I see an error can't locate Time/HiRes.pm does not exist and then re-install yum and it will work


 

Execute again to modify the table structure successfully

The table structure is as follows:


 

 



Author: meng_philip123
Link: http://www.jianshu.com/p/de79e9fe2baa
Source: Jianshu The
copyright belongs to the author. For commercial reprints, please contact the author for authorization, and for non-commercial reprints, please indicate the source.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326253416&siteId=291194637