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. POJ 1065 Wooden Sticks (贪心)

    There is a pile of n wooden sticks. The length and weight of each stick are known in advance. The st ...

  2. 初识爬虫见到的两个类 BufferedWriter和 BufferedReader

    BufferedWriter 和 BufferedReader 为带有默认缓冲的字符输出输入流,因为有缓冲区所以很效率比没有缓冲区的高. 使用BufferedWriter和BufferedReader ...

  3. Xposed Hook & Anti-hook

    一点简单记录. xposed原理包括将hook的method转为Native.因此可检测如下: for (ApplicationInfo applicationInfo : applicationIn ...

  4. N!的近似值_斯特林公式

    公式: N! ~=  sqrt(2 * PI * n) * ((n / e) ^n) 题目类型不慌都.

  5. Angular版本

    Index of (-1.6) 没有Angular 3,下一个Angular主版本将是Angular 4

  6. [LeetCode&Python] Problem 492. Construct the Rectangle

    For a web developer, it is very important to know how to design a web page's size. So, given a speci ...

  7. 为移动端而设计的bootstrap的使用

    一.下载 --bs ---css ----bootstrap.css ----bootstrap.min.css ---fonts ---js ----bootstrap.js ----jquery. ...

  8. linux简单快速启用web

    ================= jser.me/2013/11/22/快速启动web服务的两种方式.html Python的SimpleHTTPServer需要先安装python,然后执行 pyt ...

  9. C++学习(十七)(C语言部分)之 指针

    复习 数组定义格式 类型 数组名[数组大小]数组名+下标 int arr[2][3]={{1,2,3},{4,5,6}}; int arr[][3]={1,2,3,4,5,6};//二维数组定义的时候 ...

  10. 浅谈log4j-6-xml配置 转自godtrue

    <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE log4j:configuration SY ...