pt-table-checksumcss
mysql> grant select,insert,update,delete,create,drop,super,process,replication slave on *.* to 'syncuser'@'%' identified by 'Syncuser@123';
[root@node1 ~]# pt-table-checksum -usyncuser -pSyncuser@123 --nocheck-replication-filters --no-check-binlog-format --databases=test --replicate=test.checksums --create-replicate-tableChecking if all tables can be checksummed ...Starting checksum ... TS ERRORS DIFFS ROWS DIFF_ROWS CHUNKS SKIPPED TIME TABLE09-04T21:36:43 0 0 0 0 1 0 0.089 test.efs_sys_loginfo409-04T21:36:43 0 0 1006 0 1 0 0.089 test.groupby09-04T21:36:43 0 0 0 0 1 0 0.030 test.groupby109-04T21:36:43 0 1 1006 0 1 0 0.030 test.groupby209-04T21:36:43 0 0 7 0 1 0 0.030 test.student09-04T21:36:43 0 0 7 0 1 0 0.032 test.student109-04T21:36:43 0 1 0 8 1 0 0.034 test.t09-04T21:36:43 0 0 57344 0 4 0 0.328 test.t109-04T21:36:43 0 1 1 0 1 0 0.028 test.test09-04T21:36:43 0 0 8 0 1 0 0.036 test.tuser
CREATE TABLE `dsns` (`id` int(11) NOT NULL AUTO_INCREMENT,`parent_id` int(11) DEFAULT NULL,`dsn` varchar(255) NOT NULL,PRIMARY KEY (`id`));
insert into dsns(dsn) values('h=36.30.39.176,u=syncuser,p=Syncuser@123,P=3306');
TS ERRORS DIFFS ROWS DIFF_ROWS CHUNKS SKIPPED TIME TABLE09-04T22:29:52 0 0 1 0 1 0 0.029 test.dsnsTS:完成檢查的時間ERRORS:錯誤和告警的數量。DIFFS:是否一致,0表明一致,1表明不一致。ROWS:表的行數DIFF_ROWS:CHUNKS:劃分的塊的數目SKIPPED:跳過的塊的數目TIME:執行時長TABLE:表名
pt-table-syncnode
pt-table-sync h=36.30.39.117,P=3306,u=syncuser,p=Syncuser@123 --database=test --replicate='test.checksums' --execute
pt-table-sync h=36.30.39.176,P=3306,u=syncuser,p=Syncuser@123 --database=test --tables=t1 --replicate='test.checksums' --sync-to-master --execute
pt-table-sync h=36.30.39.176,u=syncuser,p=Syncuser@123,D=test,t=t1 --sync-to-master --execute
pt-table-sync h=36.30.39.176,u=syncuser,p=Syncuser@123,D=test,t=t1 h=36.30.39.213,u=syncuser,p=Syncuser@123,D=test,t=t1 --sync-to-master --execute
pt-table-sync h=36.30.39.117,u=syncuser,p=Syncuser@123,D=test,t=t1 h=36.30.39.176,u=syncuser,p=Syncuser@123 h=36.30.39.213,u=syncuser,p=Syncuser@123 --no-check-slave –execute
DSN syntax is key=value[,key=value...] Allowable DSN keys: KEY MEANING === ============================================= A 指定字符集 D 同步的數據庫 P 端口 S Socket文件 h 要鏈接的host p 數據庫密碼 t 要同步的表 u 數據庫用戶
本文分享自微信公衆號 - MySQL數據庫技術棧(Mysqltechnology)。
若有侵權,請聯繫 support@oschina.cn 刪除。
本文參與「OSC源創計劃」,歡迎正在閱讀的你也加入,一塊兒分享。mysql