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

错误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适当调大一点

错误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校验工具会根据表中的从库信息来连接从库,建表校验主从数据的一致性

建表语句:

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';

猜你喜欢

转载自blog.csdn.net/weixin_43202081/article/details/108488648