使用pt-table-checksum 3.6.0避坑指南

news/2024/10/5 23:06:09/

3.6.0在使用dsn的情况下存在bug,最后回退3.4.0版本

创建ptuser用户
#使用验证算法,否则默认会报错
#创建用户
 create user 'ptuser'@'%' identified with  sha256_password  by "你的密码";
#发现用dsn还是会报对应错误
#授权

GRANT CREATE,INSERT,SELECT,DELETE,UPDATE,LOCK TABLES,PROCESS,SUPER,REPLICATION SLAVE ON *.* TO 'ptuser'@'%';

#执行如下命令  校验nacos主从是否一致
pt-table-checksum --explain --nocheck-replication-filters --no-check-binlog-format  --replicate=test.checksums --recursion-method=hosts --databases=nacos --host=localhost --user=ptuser --port=13306 --ask-pass
加了explain不写入checksums表。
去除explain选项
pt-table-checksum --nocheck-replication-filters --no-check-binlog-format  --replicate=test.checksums --recursion-method=hosts --databases=nacos --host=localhost --user=ptuser --port=13306 --ask-pass
提示无法发现slave,查询得知:
recursion-method 如果使用hosts 需要更改从库参数,并重新启动。
因此使用dsn方式。
主库创建percona相关库及表
create database percona_schema;
CREATE TABLE percona_schema.dsns ( id int(11) NOT NULL AUTO_INCREMENT, parent_id int(11) DEFAULT NULL, dsn varchar(255) NOT NULL, PRIMARY KEY (id));
#插入从库记录
INSERT INTO percona_schema.dsns(dsn) VALUES ('h=10.255.216.78,P=13306,u=ptuser,p=你的密码'); #将从库的DSN信息写入DSN表
退出数据库,使用如下命令  
pt-table-checksum --nocheck-replication-filters --no-check-binlog-format  --replicate=test.checksums --recursion-method dsn=t=percona_schema.dsns --databases=nacos --host=localhost --user=ptuser --port=13306 --ask-pass
报错
7-05T16:13:00 Error checksumming table nacos.permissions: DBI connect(';;mysql_read_default_group=client','',...) failed: Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory at /bin/pt-table-checksum line 1639.
更改用户认证方式为native试一下:
ALTER USER  'ptuser'@'%'  IDENTIFIED WITH 'mysql_native_password' BY '你的密码';
flush privileges;
还是报错。查看插件都已经改过来了
查看perl-DBD版本
[root@CQ2-LM9601028 ~]# rpm -qa|grep perl-DBD perl-DBD-MySQL-4.023-6.el7.x86_64
查看链接:https://perconadev.atlassian.net/browse/PT-1724
似乎要升级一下插件
http://repo.percona.com/tools/yum/experimental/7/RPMS/x86_64/perl-DBD-MySQL-4.050-4.el7.x86_64.rpm

 主从库升级后,还是报错
Error checksumming table nacos.config_info: DBI connect(';;mysql_read_default_group=client','',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at /bin/pt-table-checksum line 1639.
根本不管连接的用户,发现海外用户有类似报告https://perconadev.atlassian.net/browse/PT-2250
 
退回 3.4.0版本。

回退一个rpm包

rpm -Uvh --oldpackage percona-toolkit-3.4.0-3.el7.x86_64.rpm


 执行如上命令
pt-table-checksum --nocheck-replication-filters --no-check-binlog-format  --replicate=test.checksums --recursion-method dsn=t=percona_schema.dsns --databases=nacos --host=localhost --user=ptuser --port=13306 --ask-pass

成功,发现记录不一样。使用同步工具

pt-table-sync修复

由于是生产库,数据量很小,直接重搭。
通过重新导入,再次校验,成功。

 

http://www.ppmy.cn/news/1473389.html

相关文章

el-input-number 点击加减只能加一次

el-input-number 点击加减只能加一次 <el-input-number v-model"editForm.quantity" placeholder"请输入下单数量(店均)" change"quantityChangeFn"></el-input-number>需要在方法里面加 this.$forceUpdate() quantityChangeFn(val…

云数据中心运维新纪元:让Linux服务器如虎添翼

文章目录 一、Linux系统管理的高级技巧1. 性能调优与监控&#xff1a;2. 自动化与脚本编写&#xff1a;3. 文件系统与存储管理&#xff1a; 二、服务器配置优化的策略1. 硬件选型与配置&#xff1a;2. 网络配置与优化&#xff1a;3. 应用部署与调优&#xff1a; 三、安全策略的…

当心!不要在SpringBoot中再犯这样严重的错误

1. 简介 在Spring Boot中&#xff0c;Configuration注解用于声明配置类&#xff0c;以定义和注册Bean对象。这些Bean对象可以是普通的业务组件&#xff0c;也可以是特殊的处理器&#xff0c;如BeanPostProcessor或BeanFactoryPostProcessor&#xff0c;用于在Spring容器中对其…

数据库的存储过程

数据库的存储过程 文章目录 数据库的存储过程一、定义二、最简单的存储过程&#xff08;无传入参数无返回参数的存储过程&#xff09;三、需求一四、需求二五、需求三六、删除存储过程 一、定义 存储过程是一种数据库对象&#xff0c;它封装了一组 SQL 语句和逻辑操作&#xf…

C++修饰符类型

一、存储类运算符 auto&#xff08;自动存储类&#xff0c;但在现代C中&#xff0c;它通常用于自动类型推导&#xff09; register&#xff08;建议编译器将变量存储在寄存器中&#xff0c;但现代编译器通常忽略此关键字&#xff09; static&#xff08;静态存储类&#xff…

【ARMv8/v9 GIC 系列 5.2 -- GIC 分组介绍:Group 0 |Group 1| Non-Secure Group 1】

请阅读【ARM GICv3/v4 实战学习 】 文章目录 GIC Interrupt grouping中断分组配置寄存器GIC 中断分组介绍Group 0(安全组0)Group 1(安全组1)Non-Secure Group 1(非安全组1)总结及例子GIC Interrupt grouping ARM GICv3 通过中断分组机制,与ARMv8异常模型和安全模型进行…

论文学习——使用基于多项式拟合的预测算法求解动态多目标问题

论文题目&#xff1a;Solving dynamic multi-objective problems using polynomial fitting-based prediction algorithm 使用基于多项式拟合的预测算法求解动态多目标问题&#xff08;Qingyang Zhang , Xiangyu He,Shengxiang Yang , Yongquan Dong , Hui Song , Shouyong Ji…

vue 代理

前端请求数据&#xff0c;要用ajax&#xff0c;由于浏览器的同源策略&#xff0c;涉及到跨域&#xff0c;解决跨域之后才能访问后端接口 一、常用的发送一个ajax请求&#xff1a; 1、xhr new XMLHttpRequest(),真正开发中不常用 2、jq&#xff0c;jq主要功能是获取dom&#xff…