Application of Transfer in MySQL dual-master synchronization Architecture

Source: Internet
Author: User

Some people have discussed whether Transfer can support the dual-master structure. The answer is yes. Here is a brief description.

Background

Transfer can be used as a tool other than the Master/slave database or act as a server Load balancer. This article describes the deployment structure and switching actions in these two application scenarios.

Slave Mode

A) Structure

This is the simplest dual master. What about Transfer? The code is directly written to the two masters, so they are Transfer.

B) Switch

DBAs use the switch process you are most familiar.

1) Stop updating Master1

2) Confirm that the data is fully synchronized

3) introduce the update to Master2

Here, the Transfer mechanism ensures that step 2 takes a short time (because there is no delay ).

Tool Mode

A) Structure

If you are worried about data security, you are afraid that the patch will act as master1 and master2 directly at risk (this is a responsible attitude !), It uses the representation structure.

Transfer1 (T1) and Master1 (M1) are on the same machine, while (Transfer1) T2 and (Master) M2 are on the same machine.

A diagonal line indicates the master-slave relationship. T1 indicates the slave database of M2 and T2 indicates the slave database of M1.

The vertical line indicates the update relationship. The synchronization command received by T1 is used to update M1 and T2 to update M2.

B) Switch

The switching process is exactly the same as that in the first mode.

Summary

The first O & M mode is relatively simple, but the risk is relatively high. If the Transfer has a bug, you need to update the version or change the original Master/Slave Mode, master1 and Master2 must be restarted. Not all systems can tolerate this operation.

I recommend the second mode. There are several benefits:

1. Transfer itself does not contain data, and even if it is a coredump, it will not affect the data service. The synchronization process naturally needs to switch back to the original master-slave method, so that M1 and M2 can be directly connected.

(According to the official question, why do you say it's a bug or a coredump?

I answer: Although I have already performed tests that I think are sufficient, the risks always need to be explained. This is a responsible attitude. Otherwise, you will use the data service to get involved and save me, why ?)

2. If the Master node needs to be upgraded (for example, You need to upgrade it to 5.6 in the future), Transfer does not change.

Of course, both of them are supported. If you are brave enough, you can use the first one. The free warranty is not enough.

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.