pt-table-checksum在校验时遇到的报错 总结

mysql 专栏收录该内容
3 篇文章 0 订阅

错误1

Skipping table db.table because on the master it would be checksummed in one chunk but on these replicas it has too many rows

原因:参数–chunk-size-limit默认为2,当遇到行数多的大表时pt-table-checksum可能会跳过不检测
–chunk-size-limit用默认的大小,当前表过大,超过了默认值,就跳过对该表的校验

解决:可以根据输出的提示将–chunk-size-limit适当调大一点
调大参数
–chunk-size-limit
–chunk-time
–chunk-size

错误2

Cannot connect to h=ip,p=password,u=user
This server returned more than one row for SHOW SLAVE STATUS but "channel" was not specified on the command line at pt-table-checksum line 5401.

原因:多源从库,错误可以忽略

错误3

Cannot connect to h=ip,p=password,u=user
08-30T22:31:30 Replication filters are set on these hosts:
hostname
    slave_skip_errors = 1062
Please read the --check-replication-filters documentation to learn how to solve this problem. at pt-table-checksum line 9878.

原因:属于不正常的机器设置了同步过滤规则

错误4

Cannot connect to h=ip,p=password,u=user
Cannot connect to h=ip,p=password,u=user
Cannot connect to h=ip,p=password,u=user
Cannot connect to h=ip,p=password,u=user

原因:校验时使用参数–recursion-method=processlist,表示在主库机器上利用show processlist参数获得从库ip,但是利用该命令不仅获得了从库的ip,还有其他数据库ip,所以在连其他机器时就会显示连不上

解决:将该参数–recursion-method的值变成–recursion-method dsn=D=db,t=dsns,即将需要检验的从库ip写到一个表中,pt校验工具会根据表中的从库信息来连接从库,建表校验主从数据的一致性

错误5

perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = "UTF-8", LC_ALL = (unset), LANG = "UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). 03-12T23:00:25 Replication filters are set on these hosts:xxx replicate_do_db = xxx Please read the --check-replication-filters documentation to learn how to solve this problem. at /usr/bin/pt-table-checksum line 9878.

原因:架构原因设置的过滤规则,这个报错可以忽略

建表语句:

CREATE TABLE dbname.`dsns` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`parent_id` int(11) DEFAULT NULL,
`dsn` varchar(255) NOT NULL,
PRIMARY KEY (`id`));

插入从库信息的语句

insert into dbname.dsns select null,1,'h=slaveip,u=user,p=password,P=port';
  • 0
    点赞
  • 2
    评论
  • 0
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

©️2021 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值