MySQL 8.0.28 社区版
遇见主从复制问题:** Last_IO_Error: Fatal error: Failed to run 'after_read_event' hook**
mysql> show slave status\G;
*************************** 1. row ***************************
Slave_IO_State:
Master_Host: 10.11.52.9
Master_User: docker
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: log-bin.000004
Read_Master_Log_Pos: 237
Relay_Log_File: relaylog-52.000014
Relay_Log_Pos: 409
Relay_Master_Log_File: log-bin.000004
Slave_IO_Running: No
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: 237
Relay_Log_Space: 867
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: 13117
Last_IO_Error: Fatal error: Failed to run 'after_read_event' hook
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 1
Master_UUID: baf4a32f-3b2f-11ed-b36d-bc2247b62d8c
Master_Info_File: mysql.slave_master_info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State: Replica has read all relay log; waiting for more updates
Master_Retry_Count: 86400
Master_Bind:
Last_IO_Error_Timestamp: 221013 10:16:23
Last_SQL_Error_Timestamp:
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set: baf4a32f-3b2f-11ed-b36d-bc2247b62d8c:12543-1579597
Executed_Gtid_Set: baf4a32f-3b2f-11ed-b36d-bc2247b62d8c:1-1579597,
baf74e9c-3b2f-11ed-88e2-642fc7bc87f4:1-137217
Auto_Position: 1
Replicate_Rewrite_DB:
Channel_Name: 52
Master_TLS_Version:
Master_public_key_path:
Get_master_public_key: 1
Network_Namespace:
1 row in set, 1 warning (0.01 sec)
ERROR:
No query specified
查了多方资料,不知道导致的原因是什么。
从 Read_Master_Log_Pos 位置从新建立主从关系:
STOP REPLICA;
CHANGE REPLICATION SOURCE TO
SOURCE_HOST = '10.11.52.9',
SOURCE_PORT = 3306,
SOURCE_USER = 'test',
SOURCE_PASSWORD = 'testdededede',
SOURCE_LOG_FILE = 'log-bin.000004',
SOURCE_LOG_POS = 237,
GET_SOURCE_PUBLIC_KEY = 1,
SOURCE_SSL=1
FOR CHANNEL '52';
START REPLICA;
SHOW SLAVE STATUS\G;
依然报错。
MySQL的日志:
2022-10-13T02:16:19.333621Z 1669378 [Warning] [MY-010897] [Repl] Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
2022-10-13T02:16:19.334656Z 1669378 [System] [MY-010562] [Repl] Slave I/O thread for channel '52': connected to master 'test@10.11.52.9:3306',replication started in log 'log-bin.000004' at position 237
2022-10-13T02:16:23.092127Z 1669378 [ERROR] [MY-011178] [Repl] Missing magic number for semi-sync packet, packet len: 51.
2022-10-13T02:16:23.092187Z 1669378 [ERROR] [MY-010207] [Repl] Run function 'after_read_event' in plugin 'rpl_semi_sync_replica' failed
2022-10-13T02:16:23.092223Z 1669378 [ERROR] [MY-013117] [Repl] Slave I/O for channel '52': Fatal error: Failed to run 'after_read_event' hook, Error_code: MY-013117
参考这个解决方法:
MySQL多源复制搭建-站长资讯中心
我昨天也遇到了,跟你情况一模一样,找到答案了吗?