Hi how to check data consistency between two tables in master and slave replication
Loading
Hi how to check data consistency between two tables in master and slave replication
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Srinivasan RamamoorthiPosted Sep 3, 2021, 12:52 PM
Use pt table checksum
pt-table-checksum [OPTIONS] [DSN]
pt-table-checksum performs an online replication consistency check by executing checksum queries on the master, which produces different results on replicas that are inconsistent with the master. The optional DSN specifies the master host. The tool’s “EXIT STATUS” is non-zero if any differences are found, or if any warnings or errors occur.
The following command will connect to the replication master on localhost, checksum every table, and report the results on every detected replica:
pt-table-checksum
NayakPosted Sep 4, 2021, 1:32 PM