In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
What is a master-slave copied replication crash safe?
The parameter master_info_repository has two values:
FILE (corresponding file master.info), or TABLE (corresponding table mysql.slave_master_info)
The parameter relay_log_info_repository has two values:
FILE (corresponding file relaylog.info), or TABLE (corresponding table mysql.slave_relay_log_info)
Relay-log is read and replayed by the sql_thread thread, and then the relay-log and pos point updates at the end of the replay are recorded in the relay-log.info file.
If the sql_thread playback is finished, but the final information has not been updated to the relay-log.info, the power is cut off from the library or crash is rebooted, and after the relay-log.info is read from the library, it is found that it is not the latest relay-log and pos point, and the things that have been replayed will be replayed, which will result in 1032 and 1062 errors, which is not safe for replication.
Well, in order to solve this problem, mysql5.6 began to have the option of table, which can put the update record in the innodb table and take advantage of the nature of things. Even if the sql_thread replays the relay-log, it has not been updated to the mysql.slave_relay_log_ info table. When there is a power outage from the library or crash, after the slave library is restarted, things have been replayed but have not been synchronized to the table. Sql_thread will re-read the relay-log playback. Then update to the table, this is replication crash safe.
There are two other parameters, sync_master_info (default 10000) and sync_relay_log_info (default 10000), which are used to control the frequency of updating synchronized master.info and relay-log.info files, indicating how many things are followed by fdatasync (). If the parameter equals 0, synchronization is controlled by the operating system. Do not set these two parameters too small, otherwise the disk IO may not be able to stand it. You can check the IO situation through iotop or pt-ioprofile
How do I enable the replication crash safe feature?
Master_info_repository=table
Relay_log_info_repository=table
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.