Background
Many service systems run around the clock. As the data storage software of applications, MySQL must feature high availability (HA). MySQL HA is implemented through the database replication technology. The primary-secondary replication technology of MySQL is implemented through the binlog (binary log). The primary-secondary replication is a process that replicates data from one MySQL database server (primary server) to one or more MySQL database servers (secondary servers). When the primary database is faulty, services can be manually switched to secondary databases to ensure service continuity and reliability. Currently, most MySQL databases are deployed on x86 servers. In the future, more MySQL databases will be deployed on Arm servers. This document describes how to deploy MySQL primary-secondary replication in an environment where only Arm servers are used or both Arm and x86 servers are used, and how to use the pt-table-checksum tool to check data consistency between the primary and secondary databases.
MySQL primary-secondary replication includes three modes: asynchronous, semisynchronous, and parallel replication. The difference between asynchronous and semisynchronous replication is that binlog transmission in asynchronous replication is not real-time, while that in semisynchronous replication is closer to real-time. In parallel replication, multiple threads are used to replay relay logs on secondary databases. MySQL primary-secondary replication can be implemented in traditional mode or using global transaction identifiers (GTIDs). The primary and secondary databases use the same replication mode.
The deployment mode of one primary database and two secondary databases in this document is only an example, and you can deploy more databases as required. The hardware configuration, software versions, and network planning described in Environment Configuration are used as an example for deployment. In addition, only MySQL 8.0.20 and MySQL 5.7.27 are verified in this document. If other versions are used, you can also refer to this document for deployment.
