Rate This Document
Findability
Accuracy
Completeness
Readability

Installing pt-table-checksum

Install Percona Toolkit on the client.

  1. 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
    
  2. 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
    
  3. Decompress the package.
    1
    2
    cd /home/
    tar -zxvf percona-toolkit-3.2.1.tar.gz
    
  4. 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:

    1
    cat /proc/cpuinfo | grep processor | wc -l
    
  5. Query the installation directory.
    1
    ll /usr/local/bin/pt*
    

  6. Query the tool version.
    1
    pt-table-checksum --version
    
  7. Check whether the tool can be executed properly.
    1
    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.