In the data synchronization phase of Greenplum Disaster Recovery, you:
To bootstrap the recovery cluster, you take a full backup of the primary cluster and restore on the recovery cluster.
Before you begin, be sure you have configured the primary cluster. Review the Preparation Tasks topic for details.
To take a full backup, run the following command:
gpdr backup --type full
You can perform one of two types of recovery: full or incremental; the type you choose depends on whether GPDR used an existing cluster or spun up a new one when it set up the recovery cluster.
Run the following command:
gpdr restore -t full --restore-point { <restore_point> | latest }
Run the following command:
gpdr restore -t incr --restore-point { <restore_point> | latest }
Once you have bootstrapped the recovery cluster, you will need to keep it in sync with primary cluster on an ongoing basis.
How you do this depends on whether you are performing an incremental workflow or a continuous workflow. To review the basics of each workflow type, see the Workflows topic,
In an incremental workflow, you take periodic incremental backups and restore them. You may also choose to take full backups and expire the all but the latest full backup as needed.
A typical cadence could be taking incremental backups once a week, but you may choose to do this more or less often, depending on how much traffic is hitting the cluster.
Take an incremental backup:
gpdr backup --type incr
Restore this backup:
gpdr restore -t incr --restore-point { <restore_point> | latest }
If you choose to take full backups, then:
Take a full backup
gpdr backup --type full
Restore the full backup, using the --incr
option.:
gpdr restore -t incr --restore-point { <restore_point> | latest }
In a continuous workflow, the cadence of creating restore points is frequent, as often as once every hour.
Recall that:
You may also choose to take full backups as part of a continuous workflow, and expire them as needed; however, at least one backup needs to exist
In a continuous workflow, once you have a backup, you may keep creating restore points so that GPDR can replay on the recovery cluster the WAL associated with that restore point
Every backup results in an implicit restore point
When you create an explicit restore point, GPDR associates it with the most recent backup
Follow these steps for continuous workflow:
Create a restore point:
gpdr create-restore-point
Restore this restore point
gpdr restore -t continuous --restore-point { <restore_point> | latest }
Run gpdr monitor backup
to view the progress of an ongoing backup for all segments, including the coordinator.
Greenplum disaster recovery allows you to:
You may list backups and restore points from either the primary or the recovery cluster.
For both backups and restore points, you list in order to:
To list backups:
gpdr info backup [--after-timestamp <string>] [--before-timestamp <string>] [--detail]
To list a backup's associated restore points:
gpdr info backup --format restore-points [--after-timestamp <string>] [--before-timestamp <string>] [--detail]
NoteWhen listing a backup's associated restore points, you must pass the
restore-points
string to the--format
option. As the value of--format
defaults tobackups
you need not pass it when listing backups.
GPDR allows you to display information about the most recent successful restore -- that is, the most recent restore point restored to the recovery cluster. You display this information with the gpdr info restore
command.
NoteYou may run
gpdr info restore
from the recovery cluster only.
The gpdr info restore
command yields the following information:
To conserve storage space, you may need to expire a backup or restore points, with the gpdr expire
command.
NoteThe only difference between expiring backups and expiring restore points, is that when you expire backups you also expire physical backup data.
Expiring a backup deletes the following:
Expiring restore points deletes the following:
the WAL archive and restore points associated with the backup
the WAL archive and restore points associated with any incremental backups underlying this backup
Choosing between these two commands largely hinges on which GPDR workflow you're using: incremental or continuous. Because incremental workflow results in a larger number of backup files than a continuous workflow, you will likely expire backups, rather than restore points, if you are employing an incremental workflow.
For details on the differences between incremental and continuous workflows, see the Workflows topic.
Consider the incremental workflow depicted in the following diagram:
During the time period captured in the diagram above, the user peforms two full backups and three incremental backups; each of these backups creates an implicit restore point. In addition, the user creates six explicit restore points (rp1 through rp6).
In this scenario:
If you expire Full Backup 1, it will expire:
If you expire Incr Backup 1, it will expire:
Consider the continuous workflow depicted in the following diagram:
In this scenario, if you expire the restore associated with Full Backup 1, it will expire restore points rp1 through rp7.
ImportantRunning
gpdr expire restore-points
only expires explicit restore points.
When you expire a backup or restore points, you must pass the either the --dr-restore-point
option OR the --force
option to the command. GPDR's handling of these options varies, depending on whether you are expiring backups or expiring restore points.
When you invoke the --dr-restore-point
option, you pass in the restore point of the most recent restore in the recovery cluster. GPDR then evaluates whether it is safe to expire the specified backup and the associated WAL and restore points; that is, whether doing so would prevent properly executing a continuous restore.
Choose the --dr-restore-point
option if data safety is more important to you than conserving storage. Choose the --force
option is conserving storage is more important than losing some data.
If the value of --dr-restore-point
precedes the last restore point of the backup specified by --backup-level
, then expiring the backup is not safe and GPDR will error out, because you might unintentionally delete WAL files that are required for future restores.
When passed the --force
option, GPDR deletes the backup and the restore points associated with that backup, as well as underlying incremental backups and associated restore points, without evaluating for data safety.
If the value of --dr-restore-point
precedes the implicit restore point of the backup specified by --backup-level
, then expiring the restore point is not safe and GPDR will error out, because you might unintentionally delete WAL files that are required for future restores.
GPDR expires restore points only up to the value of --dr-restore-point
; the restore point specified by --dr-restore-point
is not deleted.
When passed the --force
option, GPDR deletes the restore points associated with the backup without evaluating for data safety.
NoteThe restore points of the most recent backup cannot be deleted, even if the
--force
option is invoked. GPDR imposes this restriction to ensure that continuous restore functions correctly.