Rate This Document
Findability
Accuracy
Completeness
Readability

Installing the Tool

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 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
    
  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
    

    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.

  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.
    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.