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. Win7+Ubuntu双系统时间不一致

    转自:http://blog.sina.com.cn/s/blog_55546df90100xkf3.html 最近装了ubuntu和win7双系统,但是发现每次进入win7后时间总是不对,总是比当地 ...

  2. [转]C++智能指针简单剖析

    C++智能指针简单剖析  https://www.cnblogs.com/lanxuezaipiao/p/4132096.html 导读 最近在补看<C++ Primer Plus>第六版 ...

  3. Java基础(1)IntelliJ IDEA入门、常用快捷键和数组操作

    一. IntelliJ IDEA入门 1 快捷键和技巧 智能补全代码,比如只写首字母按回车: psvm+Enter :public stactic void main(String[] args) s ...

  4. Samsung_tiny4412(驱动笔记03)----字符设备驱动基本操作及调用流程

    /*********************************************************************************** * * 字符设备驱动基本操作及 ...

  5. TX2-static-dhcp-network

    前言 之前是使用私有的镜像而不是按照nvidia官网中JetPack3.2套件的镜像对TX2板子进行刷机,刷机之后发现网络不能正常连接,即使已经连接了有线网口,经过大师的指点才终于明白了其中的一点点奥 ...

  6. Python之路,第十三篇:Python入门与基础13

    python3   模块 模块 Module 概念: 模块是一个保护有一系统变量.函数.类等组成的程序组: 模块是一个文件,模块文件名通常以.py 结尾: 作用:让一些相关的变量,函数, 类等有逻辑的 ...

  7. urllib模块通过post请求获取数据

    功能: 输入你要查找的单词,会返回相对应的结果 import urllib.request import urllib.parse import json class youdaoSpider: de ...

  8. Ubuntu端口命令---查看端口占用及关闭

    Ubuntu查看端口使用情况,使用netstat命令: 查看已经连接的服务端口(ESTABLISHED) netstat -a 查看所有的服务端口(LISTEN,ESTABLISHED) netsta ...

  9. (21)模型层 -ORM之msql 聚合查询,F和Q(与、或、非查询)、分组查询

    什么是聚合查询,就是使用聚合函数做计算 from django.db.models import Count,Avg,Max,Min   #聚合函数要从模块中导入 from django.db.mod ...

  10. (3)diango的架构

    MVC架构:主流的web都是MVC架构 M 就是模型层指得是model,对应的就是数据库操作层 V 就是视图,和MTV架构的视图层不是一个概念,对应MTV架构中的T C 控制器,根据请求地址执行什么代 ...