Group Replication Beyond a Single Cluster: DC-DR with Percona (PS MySQL) Operator

September 17, 2026
Author
Anil Joshi
Share this Post:

A while ago, we discussed the cross-site replication feature of the Percona PXC operator. Recently, a similar cross-site replication feature was introduced in the Percona (PS MySQL) operator v1.2.0, a topology based on Group Replication/InnoDB Cluster.

In this blog post, we will explore how to add a DR Cluster to an existing DC Cluster to form a ClusterSet environment, which provides a seamless switchover between DC/DR members. The good part is that all the complexity and configuration will be managed by the Percona operator, with very few setup steps required.

Group Replication (DC-DR) using Innodb ClusterSet
Group Replication (DC-DR) using Innodb ClusterSet

 

Let’s discuss how we can implement a cross-site replication (DC-DR) topology across two separate database clusters.

Environment used for Demonstration

  • Two separate database clusters (pscluster1 and pscluster2) are deployed within a single GCP/Kubernetes environment, each managed by a dedicated operator.
  • Percona Operator for MySQL( based on Percona Server for MySQL) has a version. 1.2.0
  • MySQL version 8.4.10.
  • Network connectivity between DC/DR components.

DC (pscluster1) configuration

Step 1:  Deploying the cluster on the DC side.

Step 2: Retrieve the DC’s InnoDB cluster name, which will be required later to construct the ClusterSet.

Step 3: Get a service endpoint which is used when setting up the ClusterSet environment. We will use ps-cluster1-mysql-primary, which is mapped to the current Primary node in the existing cluster.

Step 4: The DR site should have the same credentials as DC. We need to export the DC secret containing the credentials and import it into the DR cluster.

We also need to perform a couple of cleanups in the exported secret file.

  • Remove the annotations, creationTimestamp, resourceVersion, selfLink, and uid metadata fields.
  • As per the requirement, change the namespace/instance and other unwanted details as per your replica site.

E.g,

The final ready secret file looks like this. 

DR (pscluster2) Cluster configuration

Step 1: First, we need to import the modified secret file replica-secret.yaml and initialise the DR cluster.

Also, we need to make some modifications to the custom resource file cr.yaml to initialise the DR cluster.

Note: We set spec.mysql.bootstrap.mode to manual so Pod mysql-0 does not form a Group Replication group until the ClusterSet adopts it and references the secret file we copied from the DC.

It is also expected that after applying the Custom Resource file cr.yaml, the Pod mysql-0 starts but stays NotReady. The cluster ps-cluster2 reports the Initialising state and the AwaitingExternalBootstrap condition in status. Pods mysql-1 and mysql-2 do not start until Pod mysql-0  joins the Group Replication.

Once we deploy the custom resource, we can notice the status below. Please note that the complete Pods will be ready only once DR successfully syncs and joins the DC cluster. 

Step 2: We need to note down the DR InnoDB cluster name, which will later be used by the ClusterSet.

Step 3: We need to identify the DR cluster endpoint that is reachable from the DC. This endpoint will be used to feed the clone and perform other management operations.

We will use the local FQDN ps-cluster2-mysql-0.ps-cluster2-mysql.ps-dr.svc.cluster.local of the ps-cluster2-mysql-0 Pod, which is currently initialised and awaiting the ready state.

By connecting to the DC Primary Pod, we can verify cross-communication between the DC and the DR.

Data Restoration Part

By default, when the DR site initialises and attempts to join the ClusterSet, it receives data from the source/DC via the clone recovery method.

The Operator uses MySQL Shell to create a physical snapshot of the dataset from the Source/DC and transfer it to the DR Replica.

Alternatively, we can manually perform a backup and restore on the target cluster. This strategy helps when integrating the DR site into the ClusterSet, as pre-populating the data and GTID history allows it to apply only delta changes rather than performing a full initial synchronisation. For large datasets or to prevent excessive load and performance degradation on the donor node, a backup-and-restore approach can be considered.

Here, we will use the clone recovery method to sync the DR cluster.

Next, we will deploy the ClusterSet configurations so that DR joins the DC cluster via a data clone and connects via Asynchronous Replication to stay in sync.

Below is the clusterset.yaml file where we pass the various information like (Secrets, DC/DR Endpoints, Cluster Name etc) , which we fetched in some of the above steps earlier.

We will apply the changes only to the DC node.

Please note: Member “ps-cluster2-mysql-0” on the DR side will connect to the DC via asynchronous replication. While the local members of the DR will join via the Group Replication mechanism. 

This action will also start a separate backend job on DC, which creates an associated Pod to perform the ClusterSet activity.

….

As soon as the process completes successfully, the job and associated Pod will be removed from the list.

There is one extra pod that can be noticed, and it persists. This provides a utility/client for running MySQL Shell commands against the MySQL ClusterSet.

If the job fails or errors occur, we need to investigate the exact problem using the information below.

Finally, we can check the Pod status on the DR cluster. It will now reflect all MySQL and haproxy pods in the fully completed/ready state.  

Verification of ClusterSet completion

We can check the ClusterSet information below if it has been processed successfully without any errors.

Also, we can manually access any running MySQL Pod and confirm the ClusterSet status.

Validate Replication 

  • Log in to the Primary member and perform some writes.

  • Connect to the DR and verify the sync.

We can also visit any MySQL Pod and run the following command to get the Primary member and group replication details.

DC-DR switchover/failover

Performing a planned switchover or an ad hoc failover process is quite simple here. All we need to execute the operations below.

Switchover:

Forced Failover:

So let’s try a Primary switchover activity from DC pscluster1 to DR pscluster2. Currently, pscluster2 has a REPLICA role.

Run Switchover command:

Watch the progress:

After some time, we can see pscluster2 become the Primary cluster.

Once the switchover finishes successfully, all new writes now go to the new Primary cluster ps-cluster2 and the old DC “ps-cluster1” will automatically become the Async Replica. The application should connect with a load balancer (Haproxy/MySQL Router) endpoint, e.g., (ps-cluster2-haproxy), which will forward all requests to the backend node (by default) to the Primary member.

Key Takeaways

Configuring and managing a multi-region topology manually or on virtual machines can be quite challenging. By packaging these components within the Percona PS Operator/K8S, setting up cross-region environments becomes far simpler. This streamlined deployment is critical for establishing robust disaster recovery solutions, offloading production workloads, or scaling read operations. Furthermore, built-in support for seamless DC-DR switchovers and ad hoc failovers adds significant value to the architecture.

Before deploying these topologies into production environments, it is strongly advised to thoroughly test and validate their behaviour in lower or non-production environments. Proceed with production deployment only after achieving full confidence in the setup. 

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted

Far
Enough.

Said no pioneer ever.
MySQL, PostgreSQL, InnoDB, MariaDB, MongoDB and Kubernetes are trademarks for their respective owners.
© 2026 Percona All Rights Reserved