gtid  1032同步异常处理

[root@dba_test_002 ~]# cat  3.sql
# 在从库中执行
set sql_log_bin=0;
insert into fudao_student_lable(uid,tid) values(1,11);
insert into fudao_student_lable(uid,tid) values(2,22);
insert into fudao_student_lable(uid,tid) values(3,33);
insert into fudao_student_lable(uid,tid) values(4,44);
set sql_log_bin=1; mysql> select * from fudao_student_lable;
+----+-----+-----+
| id | uid | tid |
+----+-----+-----+
| 1 | 1 | 11 |
| 2 | 2 | 22 |
| 3 | 3 | 33 |
| 4 | 4 | 44 |
+----+-----+-----+
4 rows in set (0.00 sec) # 在主库中执行
insert into fudao_student_lable(uid,tid) values(1,11);
insert into fudao_student_lable(uid,tid) values(2,22);
insert into fudao_student_lable(uid,tid) values(3,33);
insert into fudao_student_lable(uid,tid) values(4,44); mysql> select * from fudao_student_lable;
+----+-----+-----+
| id | uid | tid |
+----+-----+-----+
| 1 | 1 | 11 |
| 2 | 2 | 22 |
| 3 | 3 | 33 |
| 4 | 4 | 44 |
+----+-----+-----+
4 rows in set (0.00 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: 3272
Relay_Log_File: relay-bin.000051
Relay_Log_Pos: 2430
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: 1062
Last_Error: Could not execute Write_rows event on table test.fudao_student_lable; Duplicate entry '' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log mysql-bin.000021, end_log_pos 2452
Skip_Counter: 0
Exec_Master_Log_Pos: 2220
Relay_Log_Space: 90228961
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: 1062
Last_SQL_Error: Could not execute Write_rows event on table test.fudao_student_lable; Duplicate entry '1' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log mysql-bin.000021, end_log_pos 2452
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:20:16
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set: 0501f340-0a94-11ea-ad2b-5254007dcbb3:10-5440875
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> # 分析主库中的日志
#191204 17:20:16 server id 1574144089 end_log_pos 2268 CRC32 0xe50d7ecf GTID [commit=yes]
SET @@SESSION.GTID_NEXT= '0501f340-0a94-11ea-ad2b-5254007dcbb3:5440872'/*!*/;
# at 2268
#191204 17:20:16 server id 1574144089 end_log_pos 2340 CRC32 0xa0a551a6 Query thread_id=3294 exec_time=0 error_code=0
SET TIMESTAMP=1575451216/*!*/;
BEGIN
/*!*/;
# at 2340
#191204 17:20:16 server id 1574144089 end_log_pos 2404 CRC32 0x01555dc8 Table_map: `test`.`fudao_student_lable` mapped to num
ber 70
# at 2404
#191204 17:20:16 server id 1574144089 end_log_pos 2452 CRC32 0x6cc26db4 Write_rows: table id 70 flags: STMT_END_F
### INSERT INTO `test`.`fudao_student_lable`
### SET
### @1=1 /* INT meta=0 nullable=0 is_null=0 */
### @2=1 /* INT meta=0 nullable=0 is_null=0 */
### @3=11 /* INT meta=0 nullable=0 is_null=0 */
# at 2452 SET GTID_NEXT='0501f340-0a94-11ea-ad2b-5254007dcbb3:5440872';
BEGIN;COMMIT;
SET GTID_NEXT='AUTOMATIC';
START SLAVE;
show slave status\G; SET GTID_NEXT='0501f340-0a94-11ea-ad2b-5254007dcbb3:5440873';
BEGIN;COMMIT;
SET GTID_NEXT='AUTOMATIC';
START SLAVE;
show slave status\G; SET GTID_NEXT='0501f340-0a94-11ea-ad2b-5254007dcbb3:5440874';
BEGIN;COMMIT;
SET GTID_NEXT='AUTOMATIC';
START SLAVE;
show slave status\G; SET GTID_NEXT='0501f340-0a94-11ea-ad2b-5254007dcbb3:5440875';
BEGIN;COMMIT;
SET GTID_NEXT='AUTOMATIC';
START SLAVE;
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: 3272
Relay_Log_File: relay-bin.000051
Relay_Log_Pos: 3482
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: 3272
Relay_Log_Space: 90228961
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-5440875
Executed_Gtid_Set: 0501f340-0a94-11ea-ad2b-5254007dcbb3:1-5440875,
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 1032同步异常处理的更多相关文章

  1. gtid同步异常处理

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

  2. gtid 1032错误案例

    gtid 1032错误案例 大致背景: 分别在主从上删除了系统冗余账号. mysql> delete from mysql.user where host='::1';Query OK, 1 r ...

  3. MariaDB GTID 复制同步

    MariaDB GTID 复制同步 GTID:Global Transaction ID,全局事务ID,在整个主从复制架构中任何两个事物ID是不能相同的.全局事务ID是Mster服务器生成一个128位 ...

  4. 解决mysql开启GTID主从同步出现1236错误问题【转】

    最近遇到mysql开启gtid做复制时,从库出现1236错误,导致同步无法进行,本文就这问题记录下处理步骤,有关gtid知识在这里不做介绍,mysql版本为5.7.16. 一.错误原因分析 错误信息如 ...

  5. 解决mysql开启GTID主从同步出现1236错误问题

    解决mysql开启GTID主从同步出现1236错误问题     最近遇到mysql开启gtid做复制时,从库出现1236错误,导致同步无法进行,本文就这问题记录下处理步骤,有关gtid知识在这里不做介 ...

  6. mysql+gtid主从同步

    安装mysql  yum install mysql-community-client-5.7.17-1.el6.x86_64.rpm mysql-community-common-5.7.17-1. ...

  7. mysql 5.7 基于GTID 主从同步的1236故障处理(其它事务故障等同)

    登录从库 stop slave; 查看执行事务 show slave status\G Retrieved_Gtid_Set:  Executed_Gtid_Set: ee3bdb44-f6a1-11 ...

  8. C++异常处理:try,catch,throw,finally的用法

    写在前面 所谓异常处理,即让一个程序运行时遇到自己无法处理的错误时抛出一个异常,希望调用者可以发现处理问题. 异常处理的基本思想是简化程序的错误代码,为程序键壮性提供一个标准检测机制. 也许我们已经使 ...

  9. C++异常处理: try,catch,throw,finally的用法

    写在前面 所谓异常处理,即让一个程序运行时遇到自己无法处理的错误时抛出一个异常,希望调用者可以发现处理问题. 异常处理的基本思想是简化程序的错误代码,为程序键壮性提供一个标准检测机制. 也许我们已经使 ...

随机推荐

  1. Design Linked List

    Design your implementation of the linked list. You can choose to use the singly linked list or the d ...

  2. linux各种IPC机制

    docker中的资源隔离,一种就是IPC的隔离.IPC是进程间通信. 下面的文章转载自https://blog.csdn.net/yyq_9623/article/details/78794775 原 ...

  3. Linux 下使用 rar 进行压缩和解压缩

    1. 下载安装文件 https://www.rarlab.com/download.htm 注意下载  64位的 2. 2019.8 时的下载命令为: wget https://www.rarlab. ...

  4. windows登录密码忘记了怎么办?

    利用PE工具进行进行修改密码或者重置系统密码,正对于服务器也同样试用 目前U启动制作效果还不错,黑鲨一键装机,以及老毛桃我觉得还是算了,U深度也不错 经过这么久,小编也把该测试的测试了,,小编比较懒, ...

  5. Android UI组件:布局管理器

    为了更好的管理Android应用的用户界面中的组件,Android提供了布局管理器.通过使用布局管理器,Android应用的图形用户界面具有良好的平台无关性.通常,推荐使用布局管理器来管理组件的分布. ...

  6. [转载]Python 魔法方法详解

    据说,Python 的对象天生拥有一些神奇的方法,它们总被双下划线所包围,他们是面向对象的 Python 的一切. 他们是可以给你的类增加魔力的特殊方法,如果你的对象实现(重载)了这些方法中的某一个, ...

  7. wc、iconv命令

    一.wc:统计文件打印换行符,单词和字节数 语法:       wc [OPTION] ... [FILE] ...       wc [OPTION] ... --files0-from = F 描 ...

  8. Mysql 三大特性详解

    Mysql 三大特性详解 Mysql Innodb后台线程 工作方式 首先Mysql进程模型是单进程多线程的.所以我们通过ps查找mysqld进程是只有一个. 体系架构 InnoDB存储引擎的架构如下 ...

  9. 20-Perl 正则表达式

    1.Perl 正则表达式正则表达式(regular expression)描述了一种字符串匹配的模式,可以用来检查一个串是否含有某种子串.将匹配的子串做替换或者从某个串中取出符合某个条件的子串等.Pe ...

  10. 在Windows平台上运行Tomcat

    从之前的学习中知道,可以调用Bootstrap类将Toomcat作为一个独立的应用程序来运行,在Windows平台上,可以调用startup.bat批处理文件来启动Tomcat,或运行shutdown ...