1、从库报主键重复(Errno: 1062)
#create test data 1062
create table t1 (id tinyint not null primary key,ename varchar(20),blog varchar(50));
insert into t1 values(1,'leshami','http://blog.csdn.net/leshami');
insert into t1 values(2,'robin','http://blog.csdn.net/robinson_0612');
set sql_log_bin=off;
delete from t1 where ename='robin';
set sql_log_bin=on;
insert into t1 values(2,'robin','http://blog.csdn.net/robinson_0612');

#set
stop slave;
delete from t1 where ename='robin';
start slave;
show slave status \G

====================
2、从库报找不到对应的被更新的记录(Errno: 1032)
#slave
delete from t1 where ename='leshami';
#master
update t1 set blog='http://blog.csdn.net/robinson_0612' where ename='leshami';
#slave
show slave status \G
---set slave
stop slave sql_thread;
insert into t1 values(1,'leshami','http://blog.csdn.net/leshami');
start slave sql_thread;
show slave status \G

3、从库找不到对应的被删除的记录(Errno: 1032)
#slave
delete from t1 where ename='robin';
#master
delete from t1 where ename='robin';
#slave
show slave status \G
--set slave
stop slave sql_thread;
set gtid_next='6ad6c92a-13c2-11e7-8929-000c29511923:38';
begin;commit;
set gtid_next='AUTOMATIC';
start slave sql_thread;
show slave status \G

4、延迟从修复主库意外truncate
#master
create table t2 (id tinyint not null primary key, ename varchar(20),blog varchar(50));
insert into t2 values(1,'leshami','http://blog.csdn.net/leshami');
insert into t2 values(2,'robin','http://blog.csdn.net/robinson_0612');
select * from t2;

#slave
stop slave sql_thread;
CHANGE MASTER TO MASTER_DELAY = 300;
start slave sql_thread;
show slave status \G

#master
show master status\G
truncate table t2;
show master status\G

#slave
stop slave sql_thread;
set gtid_next='6ad6c92a-13c2-11e7-8929-000c29511923:44';
begin;commit;
set gtid_next='AUTOMATIC';
start slave sql_thread;
show slave status \G

5、主库binlog被purge的情形(Errno: 1236)

get error gtid

----

#!/usr/bin/python
import re gtid = "this iekdkdk '6ad6c92a-13c2-11e7-8929-000c29511923:534878' edkdke iekdk iekdk k"
grs= "[0-9,a-z]{8}-[0-9,a-z]{4}-[0-9,a-z]{4}-[0-9,a-z]{4}-[0-9,a-z]{12}:\d+"
rev = re.findall(grs,gtid)
print(rev[0])

gtid error set test的更多相关文章

  1. GTID复制报错处理:Last_Error: Error 'Can't drop database 'test'; database doesn't exist' on query

    创建GTID主从连接: mysql, master_user; 报错显示: Slave_IO_Running: Yes Slave_SQL_Running: No Last_Error: Error ...

  2. GTID环境中手动修复主从故障一例(Error 1236/Error 1396)

      Preface       I got an replication error 1236 when I modified the password of a user without start ...

  3. GTID环境中手动修复主从故障一例(Error 1146)

      Preface       In my last test of pt-heartbeat,both of master and slave were out of disk.And the my ...

  4. Error Code: 1786 Statement violates GTID consistency: CREATE TABLE ... SELECT.

    1.错误描述 1 queries executed, 0 success, 1 errors, 0 warnings 查询:call account_check_main('20180511') 错误 ...

  5. MySQL5.6 GTID新特性实践

    MySQL5.6 GTID新特性实践 GTID简介 搭建 实验一:如果slave所需要事务对应的GTID在master上已经被purge了 实验二:忽略purged的部分,强行同步 本文将简单介绍基于 ...

  6. MySQL5.6 新特性之GTID

    背景: MySQL5.6在5.5的基础上增加了一些改进,本文章先对其中一个一个比较大的改进"GTID"进行说明. 概念: GTID即全局事务ID(global transactio ...

  7. 与MySQL传统复制相比,GTID有哪些独特的复制姿势?

    与MySQL传统复制相比,GTID有哪些独特的复制姿势? http://mp.weixin.qq.com/s/IF1Pld-wGW0q2NiBjMXwfg 陈华军,苏宁云商IT总部资深技术经理,从事数 ...

  8. MHA+Atlas+mysql一主一从开启gtid安装配置与实验

    各节点架构 (说明:生产环境有两个节点可以组成一套完整集群,我是测试环境,因此对于manager以及atlas和binlog server都是单点,如果生产环境,相应的将manager以及atlas和 ...

  9. How to create/restore a slave using GTID replication in MySQL 5.6

    MySQL 5.6 is GA! Now we have new things to play with and in my personal opinion the most interesting ...

随机推荐

  1. 2.9 iframe

    2.9 iframe 一.frame和iframe区别Frame与Iframe两者可以实现的功能基本相同,不过Iframe比Frame具有更多的灵活性. frame是整个页面的框架,iframe是内嵌 ...

  2. SQLI DUMB SERIES-2

    less2 同Less1相同,存在注入点 输入 ?id=1' 说明我们输入的数据被原封不动的带入了,无需要在1后面加单引号 (1)爆字段 ?id=1 order by 4 字段为3. (2)用unio ...

  3. day 018 面向对象--约束和异常处理

    ---恢复内容开始--- 主要内容; 类的约束 异常处理 自定义异常 MD5加密 日志 一  类的约束 (约束是对类的约束,) 看个例子: 这是领导分配给每个人的项目,要求每人写个功能 结果如下: 例 ...

  4. lvm创建 及 扩空 等相关

    1.先对磁盘进行LVM 设置 2.pvcreate  物理卷的创建 pvcreate /dev/### 3.vgcreate 物理卷组的创建 vgcreate  vg_name  /dev/###  ...

  5. mvc core2.1 Identity.EntityFramework Core 注册 (二)

    Startup.cs-> Configure app.UseAuthentication(); //启动验证 Controllers->AccountController.cs 新建 us ...

  6. numpy数据集练习 ----------sklearn类

    # 1. 安装scipy,numpy,sklearn包 import numpy from sklearn.datasets import load_iris # 2. 从sklearn包自带的数据集 ...

  7. The Carbon driver has not been ported to 64bits, and very few parts of Windows.Forms will work properly, or at all Stacktrace

    解决地址:https://stackoverflow.com/questions/45776247/mono32-wont-work-mono64-throws-errors 应该是电脑的位与安装的m ...

  8. 彻底理解一致性哈希算法(consistent hashing)

    转载请说明出处:http://blog.csdn.net/cywosp/article/details/23397179     一致性哈希算法在1997年由麻省理工学院提出的一种分布式哈希(DHT) ...

  9. gitingore && opensource license 自动生成的网站

    老外就是爱搞事情,总有一些方便我们开发的小工具出来,比如gitignore以及开源软件许可协议的 gitingore 生成的 地址 https://www.gitignore.io/ 使用 搜索的地方 ...

  10. unity3d常用组件及分析