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 analyze the importance of skip-slave-start

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

How to analyze the importance of skip-slave-start, I believe that many inexperienced people do not know what to do. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

A problem-solving process

The original replication host needs to recreate the replication environment because of data loss, and the machine already has the backup of the main database a few days ago, so delete the data directory and put the backup directly on it. As a result, it is found that the replication is not wrong, show slave status is normal, and select count (*) a large table is also increasing, but the max id for querying the table is really slow.

So I took out the largest piece of data and found that the data is today. On the other hand, the synchronization information of slave shows that it has only read the binlog of 2 days ago.

This machine does both slave and master, setting the

Log-bin

Log-slave-updates

The environment is more complex, at first guess is not caused by environmental setting problems, but check back no problem, think about it again. Guess the cause of the problem, asked, sure enough, did not delete master.info, because the default Mysql slave will start with the database startup, so mysql will read directly from the current location, resulting in reading several pieces of today's data, and then because change master reset the copied information, so just from the max id there is no change while the data is actually increasing, waiting for these pieces of data will be reported 1062 violation of repetitive error. So for the sake of security, the database of the replication environment is still set-- the skip-slave-start parameter, to prevent replication from starting automatically as mysql starts.

After reading the above, have you mastered the method of how to analyze the importance of skip-slave-start? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

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