Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the replication error caused by the power outage of Mysql host server_errno=1236

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "how to solve replication errors caused by Mysql host power outage server_errno=1236". In daily operation, I believe many people have doubts about how to solve replication errors caused by Mysql host power outage. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts of "how to solve replication errors caused by Mysql host power outage". Next, please follow the editor to study!

A server in the computer room was short-circuited, causing the whole cabinet to trip. Several of the servers are database hosts of mysql. After restart, replication is stopped on the db of slave, and the following information is found in err:

ERROR] Error reading packet from server: Client requested master to start replication from impossible position (server_errno=1236)

[ERROR] Got fatal error 1236: 'Client requested master to start replication from impossible position' from master when reading data from binary log

[Note] Slave thread exiting O thread exiting, read up to log 'mysql-bin.000008', position 753871857

This is the famous bug of mysql. After the power outage, master regenerates the binlog, but slave does not know, but still tries to read the contents after the old binlog, resulting in a copy error. Re-change master:

CHANGE MASTER TO

MASTER_HOST='192.168.1.184'

MASTER_USER='rep'

MASTER_PASSWORD='rep'

MASTER_LOG_FILE='mysql-bin.000009'

MASTER_LOG_POS=4

Just ok.

Later, I found that a lot of slave stopped because of duplicate key. In order to make db run first, I used-- slave-skip-errors.

Just thought it was all right, the network failure led to the intranet network storm. The intranets of all the servers began to block and the applications were basically paralyzed. While letting IDC go to the computer room for the wrong line. While preparing to adjust the db and front-end external network address, there is no way, 200w an hour.

The method of change master is:

1.stop slave

two。 Back up the master.info

3. Use the complete change master statement to modify the replication configuration:

CHANGE MASTER TO

MASTER_HOST='222.74.100.184'

MASTER_USER='rep',MASTER_PASSWORD='reper'

MASTER_LOG_FILE='HBDB184-bin.073'

MASTER_LOG_POS=258096961

After 4.show slave statusG confirms that the modified information is in effect, start slave

If you just run CHANGE MASTER TO MASTER_HOST='222.74.100.184';, it may cause MASTER_LOG_FILE to be automatically set to 'HBDB184-bin.001'

Next, we need to add the rep users of the external network, adjust the firewall, add the external network accounts of the application users, and get the general message from the computer room.

At this point, the study on "how to solve replication errors caused by Mysql host power outage" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report