In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the relevant knowledge of "how to solve the problem of the master's binary log is corrupted error in MySQL". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Master-slave replication reported an error. The following is the replication status of the slave library:
Mysql > show slave status\ G
* * 1. Row *
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.129.150
Master_User: replicat
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000197
Read_Master_Log_Pos: 213271941
Relay_Log_File: mysql-relay-bin.000584
Relay_Log_Pos: 1037392990
Relay_Master_Log_File: mysql-bin.000195
Slave_IO_Running: Yes
Slave_SQL_Running: No
...
Last_Errno: 1594
Last_Error: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running' mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.
Skip_Counter: 0
Exec_Master_Log_Pos: 1037392827
Relay_Log_Space: 2368588837
...
Last_SQL_Errno: 1594
Last_SQL_Error: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running' mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.
Replicate_Ignore_Server_Ids:
Master_Server_Id: 3
Master_UUID: 58c0c354-8652-11e6-bebe-40f2e9ddc532
Master_Info_File: / data/DB/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: 161018 09:38:49
....
The relay log failed to read the master database log. Take a look at the error log message by the way. The log shows that the slave library was restarted at 09:37 and a master-slave failure occurred at 38 points, which seems to be caused by an abnormal restart of the slave library!
161018 09:37:39 mysqld_safe Number of processes running now: 0
161018 09:37:39 mysqld_safe mysqld restarted
...
2016-10-18 09:38:49 6042 [ERROR] Slave SQL: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running' mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave. Error_code: 1594
The solution is to reset the master-slave process solution:
Mysql > stop slave
Query OK, 0 rows affected (0.02 sec)
Mysql > reset slave
Query OK, 0 rows affected (0.57 sec)
Mysql > change master to master_host='192.168.129.150'
-> master_user='replicat'
-> master_password='passw'
-> master_log_file='mysql-bin.000195'
-> master_log_pos=1037392827
Query OK, 0 rows affected, 2 warnings (0.07 sec)
Mysql > start slave
Query OK, 0 rows affected (0.03 sec)
This kind of situation has not happened before from the abnormal restart of the library. I checked the relevant information on the Internet and found that it is related to the two parameters relay_log_info_repository and relay_log_info_repository.
Mysql > show variables like'% relay_log_info_repository%'
+-+ +
| | Variable_name | Value |
+-+ +
| | relay_log_info_repository | FILE |
+-+ +
1 row in set (0.00 sec)
Mysql > show variables like'% relay_log_info_repository%'
+-+ +
| | Variable_name | Value |
+-+ +
| | relay_log_info_repository | FILE |
+-+ +
1 row in set (0.00 sec)
Changing FILE to TABLE can reduce the probability of master-slave failure.
This is the end of the content of "how to solve the problem of the master's binary log is corrupted error in MySQL". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.