Using Heartbert2 to make MySQLReplication have HA

Source: Internet
Author: User
Preface the database structure of Master-Slave solves many problems, especially for applications with high readwrite performance. Structure 1: write operations are all performed on the Master

Preface The Master-Slave database mechanism solves many problems, especially for applications with high read/write values. Structure 1: write operations are all performed on the Master

Preface

The Master-Slave database mechanism solves many problems, especially for applications with high read/write performance.

1. All write operations are performed on the Master node, and the Slave database node regularly reads the bin-log of the Master node (60 s by default ).

2. distributed read requests from numerous users to more database nodes, reducing the pressure on single points of failure

Its disadvantage is:

1. Slave's real-time guarantee may require some processing for scenarios with high real-time performance.

2. high availability problem. The Master is the critical point (SPOF: Single point of failure)

This article mainly discusses how to solve the 2nd disadvantages.

The solution is as follows:

1. Use two MySQL master databases, master1 and master2, and the data is stored on the shared device. Use heartbeat2 for monitoring. When master1 fails, switch the resource to master2.

2. After a fault occurs, you do not need to modify the slave. The slave is automatically switched to master2. (Manual slave synchronization is required for power-off switching)

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.