MySQL master-slave replication principle

Source: Internet
Author: User

MySQL master-slave replication is asynchronous replication

Completed by 3 threads between master and slave
Master I/O--Main Library
Slave I/O--Standby library
Slave SQL--standby library
You must open the Binlog of the main library
1.slave I/O connects to master, starting transfer log from the specified Binlog location (master.info)
2.master I/O received a request to read Binlog sent to slave I/O and returned the following:
(1) Binlog content
(2) The log name of this read to Binlog, location
3.slave I/O writes the above (1) to the relay log end and writes the above (2) to the Master.info, knowing where to proceed with the next copy from the main repository
4.slave SQL detects that relay log is new, parses the converted SQL statement again, and executes it to the main library which binlog log name and location are recorded.

MySQL master-slave replication principle

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.