Installing the Tool
Install percona-toolkit on the client.
- Install dependencies.
1 2 3 4
yum -y install perl-DBD-mysql perl-Digest-MD5 perl-DBI perl-ExtUtils-MakeMaker perl-IO-Socket-SSL perl-TermReadKey rpm -qa | grep -i perl-DBD-mysql rpm -qa | grep -i perl-Digest-MD5 rpm -qa | grep -i perl-DBI
- Download the tool source code package.
1 2
cd /home/ wget https://www.percona.com/downloads/percona-toolkit/3.2.1/source/debian/percona-toolkit-3.2.1.tar.gz --no-check-certificate
- Decompress the package.
1 2
cd /home/ tar -zxvf percona-toolkit-3.2.1.tar.gz
- Compile the source code and install the tool.
1 2 3 4 5
cd /home/percona-toolkit-3.2.1 perl Makefile.PL make -j96 make -j96 test make -j96 install
In the command, -j96 can make full use of the multi-core feature of the CPUs to accelerate the compilation. The number following -j must be less than or equal to the number of CPU cores. You can run the cat /proc/cpuinfo | grep processor | wc -l command to query the number of CPU cores.
- Query the installation directory.
1ll /usr/local/bin/pt*
- Query the tool version.
1pt-table-checksum --version - Check whether the tool can be executed properly.
pt-table-checksum --help
If the tool usage guide is displayed, the tool is normal.
If the error message "install_driver(mysql) failed: Attempt to reload DBD/mysql.pm aborted." is displayed, rectify the fault by referring to Failed to Run the pt-table-checksum Command When Checking Whether the Primary and Secondary Databases Are Consistent.
Parent topic: Verifying Primary/Secondary Data Consistency