首页 > 学院 > 综合知识 > 正文

主从不同的端口运用pt-table-checksum校验一致性

2022-07-20 12:35:52
字体:
来源:转载
供稿:网友
  背景
  主:10.32.7.113 3306
  从:10.32.7.112 3307
 
 
   建立从库信息
  主库test库下建立表
  CREATE TABLE `dsns` ( `id` int(11) NOT NULL AUTO_INCREMENT, `parent_id` int(11) DEFAULT NULL, `dsn` varchar(255) NOT NULL, PRIMARY KEY (`id`) );
  mysql> INSERT INTO dsns (parent_id,dsn) values(1,'h=10.32.7.112,u=ptuser,p=ptpass,P=3307');    --插入从库信息
 
  [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)   --差异数据已被修复
 

(编辑:错新网)

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表