Detailed explanation of mysql dual-main architecture

1. Background

MySQL master-slave mode advantages and disadvantages

Disaster recovery: After the master database goes down, start the slave database for failover.
Backup: Prevent data loss.
Read-write separation: The master database can only be responsible for write operations, while the slave database is only used for reading. Improving query efficiency
In enterprises, database high availability has always been the focus of business attention. Many use the MySQL master-slave solution. However, a single master has a single point of failure , and manual adjustments are required to switch from the slave database to the master database. Therefore, through the dual-master or multi-master architecture, the single point of failure of the one-master and multiple-slave architecture is solved, the fault processing time of master-slave switchover is reduced, and the high availability of the MySQL cluster is increased.

2. MySQL dual-master (primary-master) architecture solution

1. Master-backup mode. Two MySQL servers are master-slave for each other. One of them serves as the master node to provide services to the outside world, and the other serves as a standby node. When the master node providing services fails, the service request will be quickly switched to The standby node is converted into a standby node after the original master node recovers from failure.

2. Master-master mode, two MySQLs are master-slave to each other, and two

Guess you like

Origin blog.csdn.net/uniquewonderq/article/details/129887760