gtid 同步1050异常处理

[root@dba_test_002 ~]# cat  2.sql
CREATE TABLE `fudao_student_lable` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(11) unsigned NOT NULL COMMENT '学员id',
`tid` int(11) unsigned NOT NULL DEFAULT '' COMMENT '老师id',
PRIMARY KEY (`id`),
KEY `index_tid` (`tid`),
KEY `index_uid` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='学员关系表'; # 在从库中创建一个表
mysql> set sql_log_bin=0;
Query OK, 0 rows affected (0.00 sec) mysql> CREATE TABLE `fudao_student_lable` (
-> `id` int(11) NOT NULL AUTO_INCREMENT,
-> `uid` int(11) unsigned NOT NULL COMMENT '学员id',
-> `tid` int(11) unsigned NOT NULL DEFAULT '' COMMENT '老师id',
-> PRIMARY KEY (`id`),
-> KEY `index_tid` (`tid`),
-> KEY `index_uid` (`uid`)
-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='学员关系表';
Query OK, 0 rows affected (0.15 sec) mysql> set sql_log_bin=1;
Query OK, 0 rows affected (0.00 sec) # 然后在主库中创建这个表
mysql> CREATE TABLE `fudao_student_lable` (
-> `id` int(11) NOT NULL AUTO_INCREMENT,
-> `uid` int(11) unsigned NOT NULL COMMENT '学员id',
-> `tid` int(11) unsigned NOT NULL DEFAULT '' COMMENT '老师id',
-> PRIMARY KEY (`id`),
-> KEY `index_tid` (`tid`),
-> KEY `index_uid` (`uid`)
-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='学员关系表';
Query OK, 0 rows affected (0.13 sec) # 在从库中出现同步异常
mysql> show slave status\G;
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 10.10.50.60
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000021
Read_Master_Log_Pos: 2220
Relay_Log_File: relay-bin.000051
Relay_Log_Pos: 1971
Relay_Master_Log_File: mysql-bin.000021
Slave_IO_Running: Yes
Slave_SQL_Running: No
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 1050
Last_Error: Error 'Table 'fudao_student_lable' already exists' on query. Default database: 'test'. Query: 'CREATE TABLE `fudao_student_lable` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(11) unsigned NOT NULL COMMENT '学员id',
`tid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '老师id',
PRIMARY KEY (`id`),
KEY `index_tid` (`tid`),
KEY `index_uid` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='学员关系表''
Skip_Counter: 0
Exec_Master_Log_Pos: 1761
Relay_Log_Space: 90227909
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 1050
Last_SQL_Error: Error 'Table 'fudao_student_lable' already exists' on query. Default database: 'test'. Query: 'CREATE TABLE `fudao_student_lable` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(11) unsigned NOT NULL COMMENT '学员id',
`tid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '老师id',
PRIMARY KEY (`id`),
KEY `index_tid` (`tid`),
KEY `index_uid` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='学员关系表''
Replicate_Ignore_Server_Ids:
Master_Server_Id: 1574144089
Master_UUID: 0501f340-0a94-11ea-ad2b-5254007dcbb3
Master_Info_File: mysql.slave_master_info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State:
Master_Retry_Count: 86400
Master_Bind:
Last_IO_Error_Timestamp:
Last_SQL_Error_Timestamp: 191204 17:03:40
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set: 0501f340-0a94-11ea-ad2b-5254007dcbb3:10-5440871
Executed_Gtid_Set: 0501f340-0a94-11ea-ad2b-5254007dcbb3:1-5440870,
137347eb-0a94-11ea-ad2b-525400dd43f8:1-531071
Auto_Position: 0
1 row in set (0.01 sec) ERROR:
No query specified mysql> # 处理方法:以主库为准
# 在从库中执行:
set sql_log_bin=0;
drop table fudao_student_lable;
set sql_log_bin=1;
start slave sql_thread;
show slave status\G; mysql> show slave status\G;
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 10.10.50.60
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000021
Read_Master_Log_Pos: 2220
Relay_Log_File: relay-bin.000051
Relay_Log_Pos: 2430
Relay_Master_Log_File: mysql-bin.000021
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 2220
Relay_Log_Space: 90227909
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 1574144089
Master_UUID: 0501f340-0a94-11ea-ad2b-5254007dcbb3
Master_Info_File: mysql.slave_master_info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it
Master_Retry_Count: 86400
Master_Bind:
Last_IO_Error_Timestamp:
Last_SQL_Error_Timestamp:
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set: 0501f340-0a94-11ea-ad2b-5254007dcbb3:10-5440871
Executed_Gtid_Set: 0501f340-0a94-11ea-ad2b-5254007dcbb3:1-5440871,
137347eb-0a94-11ea-ad2b-525400dd43f8:1-531071
Auto_Position: 0
1 row in set (0.00 sec) ERROR:
No query specified mysql> # 同步正常 [root@dba_test_002 ~]#

gtid 同步1050异常处理的更多相关文章

  1. gtid同步异常处理

    gtid同步异常处理 分析出现问题时候GTID值 通过分析法获取gtid值 通过查看mysql> show slave status \G;查看一下信息并记录下来:Retrieved_Gtid_ ...

  2. LVS+MYCAT读写分离+MYSQL同步部署手册(第三版)

    1      配置MYSQL主备同步 1.1    测试环境 mysql版本:5.6.24: 操作系统内核版本:Linux-3.13-0-32 主数据库IP:192.168.10.3: 主数据库名:d ...

  3. mysql之 mysql 5.6不停机主从搭建(一主一从基于GTID复制)

    环境说明:版本 version 5.6.25-log 主库ip: 10.219.24.25从库ip:10.219.24.22os 版本: centos 6.7已安装热备软件:xtrabackup 防火 ...

  4. GTID复制详解

    前言 GTID复制是MySQL 5.6后的新功能,在传统的方式里,主从切换后,需要找到binlog和POS点,然后执行命令change master to 指向新的主库.对于不是很有经验的人来说,往往 ...

  5. MYSQL5.7实时同步数据到TiDB

    操作系统:CentOS7 mysql版本:5.7 TiDB版本:2.0.0 同步方法:使用TiDB提供的工具集进行同步 说明: 单机mysql同步时,可以直接使用binlog同步, 但mysql集群进 ...

  6. mysql gtid 第一篇

    GTID1 简介   就是全局事务ID(global transaction identifier )2 构成   uuid+transaction_id 3 格式  7a07cd08-ac1b-11 ...

  7. MySQl新特性 GTID

    GTID简介 概念 全局事务标识符(GTID)是创建的唯一标识符,并与在源(主)服务器上提交的每个事务相关联.此标识符不但是唯一的,而且在给定复制设置中的所有服务器上都是唯一的.所有交易和所有GTID ...

  8. 使用GTID给Galera集群做数据库异步复制

    一.为什么要做Galera集群异步复制 Galera集群解决了数据库高可用的问题,但是存在局限性,例如耗时的事务处理可能会导致集群性能急剧下降,甚至出现阻塞现象.而不幸的是,类似报表等业务需求就需要做 ...

  9. mysql-5.7 调整mysql的复制方式由master_log_file+master_log_pos 到gtid 详解

    一.祖传的master_log_file + master_log_pos的复制方式面临的问题: 在很久以前 那个时候我还没有出道,mysql就已经就有复制这个功能了.如果要告诉slave库从mast ...

随机推荐

  1. SQL SERVER DATEPART函数

    定义: DATEPART函数返回指定日期的指定部分. 语法: DATEPART(datepart,date) 参数: ①datepart 参数可以是下列的值: datepart 缩写 年(Year) ...

  2. 【2018】Python面试题【web框架】

    1.谈谈你对http协议的认识. HTTP协议(HyperText Transfer Protocol,超文本传输协议)是用于从WWW服务器传输超文本到本地浏览器的传送协议.它可以使浏览器更加高效,使 ...

  3. SQL Server 数据备份存储过程

    原文:SQL Server 数据备份存储过程 今天开园,分享一下我一直在使用的数据备份存储过程,欢迎转载!!! ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ...

  4. Python特色数据类型--列表

    #list[起始索引:终止索引(不包含):步长间隔] list1[5:8] #步长省略则默认为1 #修改元素列表 #列表是一种可变的数据类型,所以可以修改内容 list1 = [0,1,2,3,4] ...

  5. Contains Duplicate III -leetcode

    Contains Duplicate III Given an array of integers, find out whether there are two distinct indices i ...

  6. Docker结合Jenkins构建持续集成环境

    1.环境说明: jenkins+svn:192.168.71.142 测试环境:192.168.71.145 生产环境:192.168.71.148 操作系统:centos7. Maven3. Tom ...

  7. python基础知识0-4

    collection 他是对字典 元组 集合 进行加工的  是计数器 无论 深 ,浅 ,赋值 拷贝 内存地址都不变 赋值也是拷贝的一种 拷贝分两类数字 字符串 另一类: 列表 字典 元组 这一类还分两 ...

  8. Codeforces1263D-Secret Passwords

    题意 给n个字符串,两个字符串之间如果有相同的字符,那么两个就等价,等价关系可以传递,问最后有多少个等价类. 分析 考虑并查集或者dfs联通块,如果是并查集的话,对于当前字符串的某个字符,肯定要和这个 ...

  9. Spring 容器中 Bean 的生命周期

    Spring 容器中 Bean 的生命周期 1. init-method 和 destory-method 方法 Spring 初始化 bean 或销毁 bean 时,有时需要作一些处理工作,因此 s ...

  10. day09 并发编程

    一. 目录 1.进程的概念和两种创建方式 2.多进程爬虫 3.守护进程 4.进程队列 5.进程队列简单应用(实现数据共享) 6.线程的两种创建方式 7.线程和进程的效率对比 8.线程共享统一进程的数据 ...