In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The principle of replication:
a. Two threads are generated from the library, one is an Icano thread and the other is a SQL thread
The iCompo thread requests the binlog of the main library and writes the resulting binlog log to the relay log (Relay Log) file.
The SQL thread reads the log in the relay log file and parses it into specific operations to achieve the consistency of the master-slave operation and the final data consistency.
b. The master library generates a log dump thread that is used to pass binlog to the slave library iUnix thread.
The basic process of replication is as follows:
The IO thread above the 1.Slave connects to the Master and requests the log contents from the specified location of the specified log file (or from the beginning of the log)
After 2.Master receives the request from the IO thread of Slave, the IO thread responsible for replication reads the log information after the specified location of the log according to the request information, and returns it to the IO thread on the Slave side. In addition to the information contained in the log, the returned information also includes the name of the Binary Log file on the Masterside and the location in the Binary Log.
After receiving the information, the I / O thread of 3.Slave writes the received log contents to the end of the RelayLog file (mysql-relay-bin.xxxxxx) on the Slave side, and records the file name and location of the read bin-log on the Masterside into the master-info file, so that the next time it is read, it can clearly tell Master, "where do I need to start the log content of a certain bin-log, please send it to me".
As soon as 4.Slave 's SQL thread detects a new addition to the Relay Log (Relay Log), it immediately parses the contents of the Log file into executable Query statements that are actually executed on the Master side, and performs these operations on its own. In this way, the same Query is actually executed on both the Master side and the Slave side, so the data on both sides is exactly the same.
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.