root@[(none)] 05:36:24> show slave status\G;
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 10.1.8.24
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000009
Read_Master_Log_Pos: 49413140
Relay_Log_File: mysqld-relay-bin.000011
Relay_Log_Pos: 2043387
Relay_Master_Log_File: mysql-bin.000002
Slave_IO_Running: Yes
Slave_SQL_Running: No
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table: zabbix.%
Replicate_Wild_Ignore_Table:
Last_Errno: 1032
Last_Error: Could not execute Update_rows event on table zabbix.user_history; Can't find record in 'user_history', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.000002, end_log_pos 28739818
Skip_Counter: 0
Exec_Master_Log_Pos: 28739081
Relay_Log_Space: 783475657
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: 1032
Last_SQL_Error: Could not execute Update_rows event on table zabbix.user_history; Can't find record in 'user_history', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.000002, end_log_pos 28739818
Replicate_Ignore_Server_Ids:
Master_Server_Id: 1
Master_UUID: 7bdd3156-ff10-11e3-91dc-001018a0b030
Master_Info_File: /var/lib/mysql/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: 140928 05:33:17
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set: 7bdd3156-ff10-11e3-91dc-001018a0b030:1-732546
Executed_Gtid_Set: 7bdd3156-ff10-11e3-91dc-001018a0b030:1-107805 #当前slave执行到的位置
Auto_Position: 1
1 row in set (0.00 sec)
ERROR:
No query specified
gtid_purged跳过事务,从上面slave状态信息可知,slave当前执行到了
7bdd3156-ff10-11e3-91dc-001018a0b030:1-107805,使用gtid_purged跳过下一个事务
7bdd3156-ff10-11e3-91dc-001018a0b030:1-107806
root@[(none)] 05:36:29> stop slave;
Query OK, 0 rows affected (0.05 sec)
root@[(none)] 05:36:35> reset master;
Query OK, 0 rows affected (0.14 sec)
root@[(none)] 05:36:38> set global gtid_purged='7bdd3156-ff10-11e3-91dc-001018a0b030:1-107806'; #跳过事务
Query OK, 0 rows affected (0.13 sec)
root@[(none)] 05:36:57> start slave;show slave status\G;
Query OK, 0 rows affected (0.04 sec)
*************************** 1. row ***************************
Slave_IO_State: Checking master version
Master_Host: 10.1.8.24
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000009
Read_Master_Log_Pos: 49436416
Relay_Log_File: mysqld-relay-bin.000011
Relay_Log_Pos: 2043387
Relay_Master_Log_File: mysql-bin.000002
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table: zabbix.%
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 28739081
Relay_Log_Space: 783498933
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: 256354
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: 1
Master_UUID: 7bdd3156-ff10-11e3-91dc-001018a0b030
Master_Info_File: /var/lib/mysql/master.info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State: Waiting for the next event in relay log
Master_Retry_Count: 86400
Master_Bind:
Last_IO_Error_Timestamp:
Last_SQL_Error_Timestamp:
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set: 7bdd3156-ff10-11e3-91dc-001018a0b030:1-732563
Executed_Gtid_Set: 7bdd3156-ff10-11e3-91dc-001018a0b030:1-107806
Auto_Position: 1
1 row in set (0.00 sec)
ERROR:
No query specified
转载于:https://my.oschina.net/anthonyyau/blog/322760
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/109717.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...