For organisations working in the digital age, disaster recovery is not an option. Because of the increasing reliance on data, system outages or data loss can be disastrous, resulting in substantial business interruptions and financial losses.
The complexity of handling disaster recovery only grows with multi-cloud or multi-regional PostgreSQL setups. Percona Operators step in to help with disaster recovery for PostgreSQL clusters running on Kubernetes. Businesses can easily manage multi-cloud or hybrid-cloud PostgreSQL deployments with the Percona Operators, ensuring that vital data is always available and safe, no matter what occurs.
This post will teach you how to configure disaster recovery with Percona Operator for PostgreSQL version 2.
A summary of the solution
Operators eliminate toil by automating regular processes. Operator offers the following standby options:
1. pgRepo-based backrest standby
2. Replication of streaming data
3. Combination of (1) and (2)
As the most basic, we will look at the repo-based standby:
1. Two Kubernetes clusters running in distinct regions, clouds, or hybrid mode (on-premises + cloud). The first is Main, and the second is Disaster Recovery (DR).
2. The following components are found in each cluster:
- Percona Operator
- PostgreSQL cluster
3. pg Backrest Backups and Write Ahead Logs (WALs) are sent to object storage via Backrest on the Main site.
4. pgBackrest on the disaster recovery site receives these backups and sends them to the standby cluster.
Set up the primary site
To deploy the Operator from our docs, use your preferred technique. Configure the Custom Resource manifest after installation so that pgBackrest begins utilising the Object Storage of your choosing. If you already have it configured, you may skip this step.
Add the necessary configuration to the backups.pgbackrest.repos section. The following is an example of Google Cloud Storage (GCS):
The keys for GCS are contained in main-pgbackrest-secrets; please read more about the settings in the backup and restoration tutorial.
Once configured, use the following custom resource: