MySQL case combat-MySQL database cluster high availability architecture

MySQL database cluster high availability architecture

Preface

This environment is based on Centos 7.8 system to build MySQL-5.7.14 for
specific construction, please refer to MySQL-5.7.14 environment construction

When the amount of online data rises sharply, it is often unrealistic to build a mysql service. This requires multiple servers to jointly complete database read and write operations. Since then, clusters have been introduced. So, what high-availability architecture does mysql cluster have, I will introduce in detail next.


MySQL master-slave architecture

This kind of structure is commonly used by startups, and it is also convenient for subsequent expansion.

Insert picture description here

Features:

  • Low cost, fast and convenient deployment (MySQL comes with functions)
  • Read and write separation
  • It can also reduce the pressure of reading the library by adding the slave library in time
  • Single point of failure
  • Data consistency problem (caused by synchronization delay)

MySQL + DRBD architecture

Through the block-based replication mode of DRBD, dual-master failover can be quickly performed, which largely solves the problem of single-point failure of the main library

Insert picture description here

Features:

  • High-availability software can use Heartbeat or keeplive, etc., fully responsible for the management of VIP, data and DRBD services
  • After the main failure, it can automatically and quickly switch, and the slave library can still synchronize data with the new master library through VIP
  • The slave library also supports separation of reading and writing, which can be implemented using middleware or programs

MySQL + MHA architecture

MHA is currently a relatively mature and common solution in the Mysql high-availability solution. It was developed by the Japanese. In the process of mysql failover, MHA can achieve fast and automatic switching operations, and it can also maintain data consistency to the maximum. .

Insert picture description here

Features:

  • Simple installation and deployment, without affecting the existing structure
  • Automatic monitoring and failover
  • Ensure data consistency
  • Manual or automatic multi-directional selection of failover mode
  • Large range of adaptation (applicable to any storage engine)

MySQL + MMM architecture

MMM stands for Master-Master Replication Manager for MySQL (mysql master master replication manager), which is a set of scalable script suites for monitoring, failover and management of MySQL master master replication configuration.

Insert picture description here

Features:

  • Safety, high stability, good scalability
  • At least three or more servers are required
  • For dual-master (higher requirements for master-slave replication)
  • The same can achieve read and write separation

Guess you like

Origin blog.csdn.net/XY0918ZWQ/article/details/113686311