For the principle of Mysql master-slave mode, refer to the online articles and add your own experiences to understand the role of MYSQL master-slave synchronization (1) Data Distribution (2) Load Balancing (loadbalancing) (3) backup (4) high Availability and fault tolerance? How does MYSQL master-slave synchronization work? Briefly describe the process: the IO thread of the slave server is from the master server
For the principle of Mysql master-slave mode, refer to the online articles and add your own experiences to understand the role of MYSQL master-slave synchronization (1) Data Distribution (2) load balancing (3) backup (4) high availability and fault tolerance? How does MYSQL master-slave synchronization work? Briefly describe the process: the IO thread of the slave server is from the master server
Principles of Mysql master-slave mode
Add your own experiences to the articles on the Internet.
Role of MYSQL master-slave Synchronization
(1) Data Distribution
(2) load balancing)
(3) backup
(4) high availability and fault tolerance
?
Principle of MYSQL master-slave Synchronization
?
Roughly describe the process: Obtain binary logs from the master server from the server's IO thread, save them as relay logs locally, and then execute the relay logs from the top through the SQL thread, so that the slave database is consistent with the master database. The detailed process of master-slave synchronization is as follows:
?
1. The master server verifies the connection.
2. The master server opens a thread for the slave server.
3. The slave server informs the master server of the log offset.
4. The master server checks whether the value is smaller than the offset of the current binary log.
5 .? If the value is smaller than, the slave server is notified to fetch data.
6 .? The slave server continues to fetch data from the master server until the data is obtained. At this time, the slave server thread goes to sleep while the master server thread goes to sleep.
7.When the master server is updated, the master server thread is activated and binary logs are pushed to the slave server.And notifies the slave server thread to enter the working state.
8. Run the binary log from the SQL thread on the server and then go to sleep.
?
Through the above introduction, we can understand why the "YES" status is only available when the Slave_IO and Slave_ SQL processes run normally when the command show slave status \ G is executed from the node, the slave node can synchronize data with the master node.
? Show slave status \ G result display parameters can refer to the official manual http://dev.mysql.com/doc/refman/5.1/en/show-slave-status.html
?