In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
MySQL database how to achieve replication operation, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.
MySQL database replication operations can be roughly divided into three steps:
Step 1: the master server records changes to the data in the binary log.
Step 2: copy the binary log events of the master server to its relay log (relay log) from the slave server.
Step 3: redo the events in the relay log from the server to keep the data changes synchronized with the slave server.
The detailed steps are as follows:
First of all, the primary server records the binary log. Before the update data of each transaction is completed, the primary server records the information of these operations in the binary log. After the event is written to the binary log, the primary server notifies the storage engine.
Commit the transaction.
The Master O process on the Slave connects to the Master and sends a log request. After receiving the request from the IO process of Slave, the IO process responsible for replication reads the log information after the specified location of the log is established according to the request information.
The IO process returned to Slave. In addition to the information contained in the log, the returned information also includes the location where the name of the bin-log file on the Masterside has been bin-log.
After receiving the information, the Slave's I > O process adds the received log contents to the end of the relay-log file on the server side, and records the file and location read to the bin-log on the Masterside to the master-info file.
As soon as Slave's SQL process detects new content in replay-log, it immediately parses the content of replay-log into the executable content that is actually executed on the Masterside and executes it on its own.
More than 90% of MySQL replication environments are architecture patterns of one Master with one or more Slave. If the pressure on master and slave is not too great, asynchronous
Replication latency is generally small. Especially after the replication mode of the slave terminal is changed to two processes, the delay of the slave terminal is reduced.
Note: for applications that are not particularly strict in real-time data, you only need to expand the number of slave through cheap PC servers and spread the read pressure to multiple slave
The bottleneck of read pressure on the database side can be solved on the machine. To a great extent, this has solved the bottleneck of database pressure on the websites of many small and medium-sized enterprises, even some
Large websites are using similar solutions to solve MySQL database bottlenecks.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
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.