Rate This Document
Findability
Accuracy
Completeness
Readability

Verifying Primary/Secondary Data Consistency

Check the data consistency between the Kunpeng and x86 nodes to ensure the accuracy of data synchronization.

  1. Install the verification tool.

    Install and run the pt-table-checksum tool on the MySQL server. For details, see Installing the Tool and Running the Tool in the Primary-Secondary Replication Deployment Guide.

  2. Verify primary/secondary data consistency.
    pt-table-checksum h=192.168.0.1,u=checksums,p=123456,P=3306 --databases=tpcc --no-check-binlog-format --replicate=pt.checksums --max-lag=3 --recursion-method=hosts

    Modify the following parameters as required:

    • h=192.168.0.1: IP address of the primary database server
    • u=checksums: user name used for verification
    • p=123456: user password
    • --databases=tpcc: the name of the database to be verified
    • Other parameters are used to optimize the verification process, such as log format check and maximum latency processing.

    After the verification is complete, check the output and ensure data consistency. Synchronize the data if inconsistent records exist. Expected result (partial):

  3. Optional: Synchronize the data if inconsistent records exist.

    Run pt-table-sync to perform primary/secondary data synchronization. If the pt-table-checksum tool has been installed by following the instructions provided in Installing the Tool in the Primary-Secondary Replication Deployment Guide, the pt-table-sync tool has also been installed.

    Run the following commands on the primary database server to complete primary/secondary data synchronization:

    pt-table-sync h='192.168.0.1',u='replicate',p='123456',P=3306 h='192.168.0.3',u='root',p='123456',P=3306 --print --execute --verbose

    Modify the following parameters as required:

    • h=192.168.0.1: IP address of the primary database server
    • h=192.168.0.3: IP address of the secondary database 2 (Kunpeng) server