Installing pt-table-checksum
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 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
-j96 leverages the multi-core CPUs to speed up the compilation. The number following -j indicates the number of CPU cores needed for parallel compilation. The value must be less than or equal to the number of CPU cores. You can run the following command to view the number of CPU cores:
1cat /proc/cpuinfo | grep processor | wc -l
- 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.
1pt-table-checksum --helpIf 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