-
[root@DB-22 ~]# pt-table-sync --replicate test.checksum --sync-to-master h=10.32.7.112,P=3307,u=ptuser,p=ptpass --database=otter --print
-
REPLACE INTO `otter`.`testtab`(`id`) VALUES ('2') /*percona-toolkit src_db:otter src_tbl:testtab src_dsn:P=3306,h=10.32.7.113,p=...,u=ptuser dst_db:otter dst_tbl:testtab dst_dsn:P=3307,h=10.32.7.112,p=...,u=ptuser lock:1 transaction:1 changing_src:test.checksum replicate:test.checksum bidirectional:0 pid:22358 user:root host:DB-22*/;
-
-
[root@DB-22 ~]# pt-table-sync --replicate test.checksum --sync-to-master h=10.32.7.112,P=3307,u=ptuser,p=ptpass --database=otter --execute
mysql> select * from testtab;
+----+
| id |
+----+
| 1 |
| 2 |
+----+
2 rows in set (0.00 sec) --差異數據已被修復
參考:http://www.freeoa.net/osuport/db/chk-and-rep-mysql-msprob-by-percona-toolkit_3098.html