[ZZ] MySQL High-availability solution

Source: Internet
Author: User
Tags failover

MySQL High-availability solution (MySQL HA solution)

What is high availability?
Many companies have 24 hours * 365 days of uninterrupted service. Call Center, for example. This requires high availability. Another example is the shopping site, which must be traded at any time. Then, when the server of the shopping network hangs one, it cannot have any impact on the business. This is high availability.

High Availability 2 Questions:
How do I share data or synchronize data? How to deal with failover?
Explain failover, meaning that when the server is down, or when the error occurs, you can automatically switch to other standby servers, do not affect the operation of the app on the server.

For distributed database systems. How can the architecture be guaranteed to be highly available? Take MySQL for example.
1. Mysqlreplication with manual failover
Synchronizing data is a method of using MySQL replication, which is explained in MySQL sub-table chunking to master and slave. Simply put, from the library according to the main library of the log to do the corresponding processing, to ensure the consistency of the data. Usually also with MySQL proxy or amoeba and other read-write separation to reduce server pressure.
Manual failover, obviously when master hangs up, using this method requires manual processing of failover, typically changing slave to server.
Availability achieved: 98%-99.9+%

2.master-master with MMM Manager (multi-master Replication Manager)
The way to synchronize data is multi-master Replication Manager, in MySQL sub-table chunking to master-slave interpretation, multi-master multi-slave settings, is a loop ring, each db is both the previous DB of the slave and the second master. The advantage is that a master hangs up and can continue the db operation. Each DB can read and write, dispersing pressure.
Availability up to: 99%

3.heartbeat/san
The way to deal with failover is that heartbeat,heartbeat can be seen as a set of programs that monitor the network that manages the connections between each node. When node error occurs, the other node start service is started automatically. One problem that heartbeat must solve is split brain, after a node in the network is down, each node will assume that the other node is down and try to start the service because of a data conflict.

Share data over a SAN.
San:storage area Network is a LAN that handles the transmission of large amounts of data, providing data transfer between the computer and the storage system. A cluster of individual computers can be stored through a SAN share.


When the Server1 hangs, heartbeat monitors the service to start the Server2. Because sans are used to share storage, SERVER2 can directly leverage data from San Networks. This is the way to provide a highly available solution.
Availability achieved: 99.5%-99.9%

4.heartbeat/drbd
The way to deal with failover is still heartbeat.
Synchronizing data using drbd:distributed replicated block Device (DRBD) is a software-implemented, non-shared storage replication solution for mirrored block device content between servers. Unlike San Networks, it does not share storage, but rather replicates data through the network between servers.

Availability up to: 99.9%

5. Mysqlcluster (NDB Cluster)
MySQL cluster is also composed of a cluster of each DB node, which is connected by the network in this cluster. You can freely increase or decrease the number of node to correspond to the database pressure.

Synchronize each node's data in a way that synchronous replication (synchronous replication, or both succeed or fail at the same time). The table is then partition, based on the primary key for each table.

The structure of shared nothing architecture is adopted. Instead of sharing any data, each node synchronizes its own data. This way, even a PC can be easily added to the structure of shared nothing.

Share Disk sharenothing Sharememory

It's hard to understand, I guess the MySQL cluster structure should be similar to the HDFs (Hadoop distributed File System) in Hadoop, partition by Key, Then the various partition are saved by synchronous to each Datanode, Management node to listen to the management cluster, through SQL node to access the data on the Datanode.

Availability percent Data Source:
http://www.mysqlperformanceblog.com/2009/10/16/finding-your-mysql-high-availability-solution-–-the-questions/

Turn from:

Http://blog.sina.com.cn/s/blog_7e89c3f501012vtr.html

[ZZ] MySQL High-availability solution

Related Article

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.