Features, Fault Detection, Limitations, and Deployment Scripts for MySQL Group Replication (MGR)
This article outlines MySQL Group Replication’s key features, fault-detection mechanism, limitations, required environment, and step-by-step deployment scripts, providing a practical guide for setting up a high-availability MySQL cluster on CentOS using the provided shell scripts and configuration files.
1. MGR Features
MySQL Group Replication (MGR) is a high‑availability and scalability solution introduced in MySQL 5.7.17 as a plugin, providing eventual consistency in a distributed environment.
High consistency: based on distributed Paxos protocol ensuring data consistency.
High fault tolerance: automatic detection; works as long as a majority of nodes are alive, with built‑in split‑brain protection.
High scalability: nodes can be added or removed; new nodes automatically synchronize incremental data until consistent.
High flexibility: supports single‑primary and multi‑primary modes; single‑primary can auto‑elect a new primary on failure, while multi‑primary allows writes on multiple nodes.
2. Group Replication Fault Detection
Fault detection is a distributed service that provides guesses about which servers may have died. When a server stops responding, the remaining members coordinate to exclude the suspect. If a server becomes isolated from the rest, it suspects all others have failed, but without a quorum its suspicion has no effect. The online server list is called a view; the group dynamically reconfigures and updates the view when members join or leave.
3. Limitations of Group Replication
Storage engine must be InnoDB; each table requires a primary key for write‑set conflict detection.
Only IPv4 is supported and network requirements are high.
GTID must be enabled and binary log format set to ROW.
COMMIT may fail similarly to snapshot isolation failures.
A cluster can contain at most nine nodes.
Foreign keys and savepoints are not supported, preventing global constraint checks and partial rollbacks.
Binary log does not support replication event checksums.
Multi‑primary mode does not support the SERIALIZABLE isolation level.
Multi‑primary mode cannot fully enforce cascading foreign‑key constraints.
DDL cannot be executed concurrently on the same database object across different nodes in multi‑primary mode.
Environment: CentOS 7.8.2003 (Core) and MySQL 8.0.18.
Prerequisites: firewalls disabled, control machine can SSH to all nodes. Nodes: 192.168.17.170 (control), 192.168.17.132 (master), 192.168.17.133 (slave1), 192.168.17.135 (slave2).
Files placed under /shell/installmgr on the control machine: hostnameimport.txt, hostnameip.txt, installmgr.sh, mgrmastercreate.sh, mgrslavecreate.sh, my.cnf, mysqld, mysqlinstall.sh, mysql.local, and the MySQL tarball.
Execution: run sh installmgr.sh on the control machine; wait 3‑5 minutes for the cluster to be built.
Scripts (installmgr.sh, mysqlinstall.sh, mgrmastercreate.sh, mgrslavecreate.sh) are edited with vim; their contents are shown in the original images.
Hostname mapping files contain the IP‑hostname pairs and node IDs as listed.
Practical DevOps Architecture
Hands‑on DevOps operations using Docker, K8s, Jenkins, and Ansible—empowering ops professionals to grow together through sharing, discussion, knowledge consolidation, and continuous improvement.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.