Cross-site replication is implemented using InnoDB ClusterSet and is only available for clusters using spec.mysql.clusterType: group-replication. It is not supported for async cluster types.
Replication Roles
- Primary Cluster: Accepts writes and replicates asynchronously to replica clusters. Its internal Group Replication (GR) membership remains unchanged.
- Replica Cluster: Serves reads only (
SUPER_READ_ONLY=ON). It receives asynchronous replication from the primary cluster's PRIMARY member and maintains its own internal GR for high availability within its local site.
ClusterSet Lifecycle
- Bootstrap: A new replica cluster is initialized with
spec.mysql.bootstrap.mode: manual so its first pod starts as a standalone instance rather than attempting to form a GR group immediately. - Joining: The
PerconaServerMySQLClusterSet controller runs createReplicaCluster(), which configures the standalone instance to join the ClusterSet. - Scaling: Once the first member of the replica cluster is part of the ClusterSet, other pods in that site can join the local GR group using the standard
addInstance path.
To participate in a ClusterSet, a cluster must be an InnoDB Cluster or a clean standalone GR-capable instance.
# Example of a cluster configured to become a replica in a ClusterSet
apiVersion: ps.percona.com/v1
kind: PerconaServerMySQL
metadata:
name: cluster2
spec:
mysql:
clusterType: group-replication
size: 3
bootstrap:
mode: manual # Required for ClusterSet replica clusters
secretsName: cluster2-creds