MySQL Replication principle

Source: Internet
Author: User

1. Three threads: Main Library binlog dump thread, from library I/O thread and SQL thread.

2.creation Process: When replication starts from the library (start Slave), you first createI/Othreads Connect to the main library, and the main library then createsBinlog Dumpthread readsBinlogevents in the log (Event) sent toI/Othreads,I/Oafter the thread gets the event, update the relay log from the library (Relay Log), and then from the librarySQLthe thread reads the events in the trunk log and applies them.

3. Span style= "Font-family:simsun;" lang= "ZH-CN" xml:lang= "ZH-CN" > follow-up procedure:

     One, main library binlog dump thread reads binlog Span style= "Font-family:simsun;" lang= "ZH-CN" xml:lang= "ZH-CN" > events in log ( event ) sent to i/o thread;

Second,I/o thread Gets the event update from the Library relay log (relaylog);

Third, read the events in the trunk log from the SQL thread on the library and apply.


650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/8A/0C/wKiom1gkfbKD1akjAACT_-bgaF0950.png-wh_500x0-wm_3 -wmp_4-s_4048576214.png "title=" copy principle. PNG "alt=" Wkiom1gkfbkd1akjaact_-bgaf0950.png-wh_50 "/>

This article is from the "Data Chen" blog, please be sure to keep this source http://jianhuchenmou.blog.51cto.com/7449945/1871628

MySQL 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.