--模拟 1062 故障--主库
CREATE TABLE`info_area` (
`id`int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '地区ID',
`name`varchar(20) NOT NULL DEFAULT '' COMMENT '名称',
`rel_id`varchar(50) NOT NULL DEFAULT '' COMMENT '关系ID',
`pid`int(10) unsigned NOT NULL DEFAULT '0' COMMENT '父ID',
`level` int(11) NOT NULL DEFAULT '0' COMMENT '类别,1、省份 2、市 3、区 4、县',PRIMARY KEY(`id`),UNIQUE KEY`UNQ_RID` (`rel_id`) USING BTREE,KEY`IDX_PID` (`rel_id`)
) ENGINE=InnoDB AUTO_INCREMENT=55185 DEFAULT CHARSET=utf8mb4 COMMENT='地区表';INSERT INTO `info_area` (`id`, `name`, `rel_id`, `pid`, `level`) VALUES ('10000', '北京', '10000', '10000', '1');INSERT INTO `info_area` (`id`, `name`, `rel_id`, `pid`, `level`) VALUES ('10002', '三环以内', '100001000110002', '10001', '3');INSERT INTO `info_area` (`id`, `name`, `rel_id`, `pid`, `level`) VALUES ('10003', '三环到四环之间', '100001000110003', '10001', '3');
mysql> select * frominfo_area;+-------+-----------------------+-----------------+-------+-------+
| id | name | rel_id | pid | level |
+-------+-----------------------+-----------------+-------+-------+
| 10000 | 北京 | 10000 | 10000 | 1 |
| 10002 | 三环以内 | 100001000110002 | 10001 | 3 |
| 10003 | 三环到四环之间 | 100001000110003 | 10001 | 3 |
+-------+-----------------------+-----------------+-------+-------+
3 rows in set (0.00sec)--从库上执行
set sql_log_bin=0;INSERT INTO `info_area` (`id`, `name`, `rel_id`, `pid`, `level`) VALUES ('10001', '朝阳区', '1000010001', '10000', '2');set sql_log_bin=1;--主库
INSERT INTO `info_area` (`id`, `name`, `rel_id`, `pid`, `level`) VALUES ('10001', '朝阳区', '1000010001', '10000', '2');--从库
show slave status\G;
mysql>show slave status\G;*************************** 1. row ***************************Slave_IO_State: Waitingfor master tosend event
Master_Host:10.192.30.53Master_User: repl
Master_Port:3306Connect_Retry:60Master_Log_File: mysql-bin.000002Read_Master_Log_Pos:705517Relay_Log_File: fudao_db_cluster_003-relay-bin.000003Relay_Log_Pos:2478Relay_Master_Log_File: mysql-bin.000002Slave_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: test.%,information_schema.%Last_Errno:1062Last_Error: Coordinator stopped because there were error(s)in the worker(s). The most recent failure being: Worker 1 failed executing transaction '46760eb0-bcb3-11e9-a352-24a9c4e7e87e:79' at master log mysql-bin.000002, end_log_pos 705486. See error log and/or performance_schema.replication_applier_status_by_worker table for more details about this failure or others, if any.
Skip_Counter:0Exec_Master_Log_Pos:705195Relay_Log_Space:5837Until_Condition: None
Until_Log_File:
Until_Log_Pos:0Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master:NULLMaster_SSL_Verify_Server_Cert: No
Last_IO_Errno:0Last_IO_Error:
Last_SQL_Errno:1062Last_SQL_Error: Coordinator stopped because there were error(s)in the worker(s). The most recent failure being: Worker 1 failed executing transaction '46760eb0-bcb3-11e9-a352-24a9c4e7e87e:79' at master log mysql-bin.000002, end_log_pos 705486. See error log and/or performance_schema.replication_applier_status_by_worker table for more details about this failure or others, if any.
Replicate_Ignore_Server_Ids:
Master_Server_Id:3306Master_UUID: 46760eb0-bcb3-11e9-a352-24a9c4e7e87e
Master_Info_File: mysql.slave_master_info
SQL_Delay:0SQL_Remaining_Delay:NULLSlave_SQL_Running_State:
Master_Retry_Count:86400Master_Bind:
Last_IO_Error_Timestamp:
Last_SQL_Error_Timestamp:190813 13:47:05Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set: 46760eb0-bcb3-11e9-a352-24a9c4e7e87e:66-79Executed_Gtid_Set: 46760eb0-bcb3-11e9-a352-24a9c4e7e87e:1-78Auto_Position:1Replicate_Rewrite_DB:
Channel_Name:
Master_TLS_Version:
Master_public_key_path:
Get_master_public_key:0Network_Namespace:1 row in set (0.00sec)
ERROR:
No query specified
mysql>