gpt4 book ai didi

mysql从站一直卡在从中继日志中读取事件

转载 作者:行者123 更新时间:2023-11-29 18:18:40 25 4
gpt4 key购买 nike

前两天,我在master上通过“source xxx.sql”导入数据,有135万行记录,总大小10G,执行导入操作后master一切正常。但是master上已经完成了两天了,slave的状态仍然是“Reading event from the relay log”,谁能帮我解决这个问题?先谢谢了。

以下是有关从属状态的详细信息:

mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.1.50
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.001137
Read_Master_Log_Pos: 43132410
Relay_Log_File: mysql-relay-bin.002897
Relay_Log_Pos: 497809898
Relay_Master_Log_File: mysql-bin.001130
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: 497809685
Relay_Log_Space: 40113924576
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: 161225
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: 0f9e9ec5-ed9f-11e5-9a4a-525400c50c20
Master_Info_File: /data/mysql1/master.info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State: Reading event from the 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:
Executed_Gtid_Set:
Auto_Position: 0
Replicate_Rewrite_DB:
Channel_Name:
Master_TLS_Version:
1 row in set (0.00 sec)

以下是从站上的中继日志列表:

-rw-r----- 1 mysql mysql  254 Oct 15 11:17 mysql-relay-bin.002896
-rw-r----- 1 mysql mysql 19G Oct 15 11:40 mysql-relay-bin.002897
-rw-r----- 1 mysql mysql 161K Oct 15 11:40 mysql-relay-bin.002898
-rw-r----- 1 mysql mysql 254 Oct 15 11:40 mysql-relay-bin.002899
-rw-r----- 1 mysql mysql 67M Oct 15 12:10 mysql-relay-bin.002900
-rw-r----- 1 mysql mysql 18G Oct 15 12:14 mysql-relay-bin.002901
-rw-r----- 1 mysql mysql 112K Oct 15 12:14 mysql-relay-bin.002902
-rw-r----- 1 mysql mysql 254 Oct 15 12:14 mysql-relay-bin.002903
-rw-r----- 1 mysql mysql 420 Oct 15 12:14 mysql-relay-bin.002904
-rw-r----- 1 mysql mysql 4.4M Oct 15 12:14 mysql-relay-bin.002905
-rw-r----- 1 mysql mysql 254 Oct 15 12:14 mysql-relay-bin.002906
-rw-r----- 1 mysql mysql 420 Oct 15 12:14 mysql-relay-bin.002907
-rw-r----- 1 mysql mysql 254 Oct 15 12:14 mysql-relay-bin.002908
-rw-r----- 1 mysql mysql 122M Oct 15 14:34 mysql-relay-bin.002909
-rw-r----- 1 mysql mysql 207 Oct 15 14:34 mysql-relay-bin.002910
-rw-r----- 1 mysql mysql 7.9M Oct 15 15:27 mysql-relay-bin.002911
-rw-r----- 1 mysql mysql 207 Oct 15 15:27 mysql-relay-bin.002912
-rw-r----- 1 mysql mysql 371K Oct 15 15:34 mysql-relay-bin.002913
-rw-r----- 1 mysql mysql 207 Oct 15 15:34 mysql-relay-bin.002914
-rw-r----- 1 mysql mysql 76M Oct 15 23:00 mysql-relay-bin.002915
-rw-r----- 1 mysql mysql 5.3M Oct 15 23:59 mysql-relay-bin.002916
-rw-r----- 1 mysql mysql 254 Oct 15 23:59 mysql-relay-bin.002917
-rw-r----- 1 mysql mysql 36M Oct 16 08:05 mysql-relay-bin.002918
-rw-r----- 1 mysql mysql 4.4M Oct 16 08:22 mysql-relay-bin.002919
-rw-r----- 1 mysql mysql 979M Oct 16 23:00 mysql-relay-bin.002920
-rw-r----- 1 mysql mysql 5.5M Oct 16 23:58 mysql-relay-bin.002921
-rw-r----- 1 mysql mysql 254 Oct 16 23:58 mysql-relay-bin.002922
-rw-r----- 1 mysql mysql 38M Oct 17 08:02 mysql-relay-bin.002923
-rw-r----- 1 mysql mysql 6.6M Oct 17 08:53 mysql-relay-bin.002924
-rw-r----- 1 mysql mysql 725 Oct 17 08:02 mysql-relay-bin.index

最佳答案

查看Seconds_Behind_Master:161225从站状态输出中的线路,目前延迟为 44 小时。

运行show Slave status几次并对其变化率提出建议,如果一切正常,它应该不断下降。

为了加快从服务器的速度,您可以减少服务器上的负载:停止查询一段时间并停止服务器上发生的任何其他事件。

但是,您可能会发现从主站的新鲜转储中重置从站是合理的,percona 的 xtrabackup 可以在不锁定数据库的情况下完成此操作(除非您经常使用 MyISAM,因为它最适合 innodb 引擎)。

关于mysql从站一直卡在从中继日志中读取事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46781152/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com