MySQL high availability solution

Source: Internet
Author: User
What is high availability? Many companies provide 24 hours * 365 days of uninterrupted services. For example, CallCenter. This requires high availability. For example, a shopping website can be traded at any time. When the shopping network server fails, it cannot have any impact on the business. This is high availability. High Availability: how to share data or

What is high availability? Many companies provide 24 hours * 365 days of uninterrupted services. For example, Call Center. This requires high availability. For example, a shopping website can be traded at any time. When the shopping network server fails, it cannot have any impact on the business. This is high availability. High Availability: how to share data or

What is high availability? Many companies provide 24 hours * 365 days of uninterrupted services. For example, Call Center. This requires high availability. For example, a shopping website can be traded at any time. When the shopping network server fails, it cannot have any impact on the business. This is high availability.


Two problems with High Availability:
How to share or synchronize data? How to deal with failover?
Failover means that when the server is down or an error occurs, the server can be automatically switched to another standby server without affecting the operation of the App on the server.


For distributed database systems. How can the architecture ensure its high availability? Take MySQL as an example.
1. MySQL replication with manual failover uses the MySQL replication method to synchronize data. It has been explained to the master and slave nodes in MySQL table sharding. Simply put, the slave database processes the logs of the master database to ensure data consistency. MySQL Proxy or Amoeba is usually used for read/write splitting to reduce the pressure on the server.
Manual failover. Obviously, when the Master fails, you need to manually handle the failover in this mode. Generally, you need to change the slave to the server.
Availability: 98%-99.9 + %


2. the Master-Master with MMM manager (Multi-Master Replication Manager) synchronizes data by means of Multi-Master Replication Manager. in MySQL, the sub-tables are segmented to the Master-slave interpretation, and the Multi-Master and Multi-slave settings are implemented, it is a loop, and each DB is both the Slave of the previous DB and the Master of the next database. The advantage is that a Master fails and the database operation can continue. Each database can be read and written to distribute the pressure.
Availability up to: 99%


3. Heartbeat/SAN processes failover in the form of Heartbeat. Heartbeat can be viewed as a group of programs that monitor and manage the networks connected to each node. When a node error occurs, other nodes are automatically started to start the service. One problem that Heartbeat must solve is split brain. After a node in the network is down, each node will think that other nodes are down and try to start the service because of data conflicts.


Share data through SAN.
SAN: Storage Area Network (SAN) is a type of LAN for processing large data volumes. It provides data transmission between a computer and a Storage system. Clusters composed of computers can share storage through SAN.
MySQL high availability solution (MySQL HA Solution)


When server1 fails, Heartbeat monitors the service that starts server2. Because SAN is used to share the storage, Server2 can directly use the data in the SAN network. This method provides highly available solutions.
Availability: 99.5%-99.9%


4. Heartbeat/DRBD still processes failover in Heartbeat mode.
Data synchronization using DRBD: Distributed Replicated Block Device (DRBD) is a software-implemented, non-shared, storage and replication solution for image Block Device content between servers. Unlike the SAN network, it does not share storage, but copies data through the network between servers.

MySQL high availability solution (MySQLHASolution)


Availability up to: 99.9%


5. MySQL Cluster (NDB Cluster)

The MySQL Cluster is also composed of each DB node and is connected by a network in this cluster. You can freely increase or decrease the number of nodes to cope with database pressure.


MySQL high availability solution (MySQL HA Solution)


Use synchronous replication to synchronize data of each node. Then, partition each table based on the primary key of each table.

Adopts the Shared Nothing Architecture structure. Instead of sharing any data, each node synchronizes its own data. In this way, even the PC can be easily added to the Shared Nothing structure.

Share disk Share nothing Share memory


MySQL high availability solution (MySQL HA Solution)
It is hard to understand. I guess the MySQL Cluster structure should be similar to HDFS (Hadoop Distributed File System) in Hadoop, and partition should be performed according to the key, then, each partition is synchronously saved to each DataNode through synchronous. The Management Node monitors and manages the Cluster, and uses the SQL Node to access data on DataNode.


Availability percentage data source:
Http://www.mysqlperformanceblog.com/2009/10/16/finding-your-mysql-high-availability-solution---the-questions/

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.