Cluster Restore

As of version 1.3.0, the PolarDB-X Operator has rolled out support for full backup restore.This guide will walk you through the steps to restore a PolarDB-X cluster using an available backup set.

Restoring PolarDB-X Cluster

PolarDB-X offers two approaches for restoring from a backup set:

  • Restore from a specific backup set object
  • Restore from backup set files

Restore from a Specific Backup Set Object

This method requires that the corresponding PolarDBXBackup object for the backup set still exists within the kubernetes cluster, and that the backup files are still preserved in remote storage.

apiVersion: polardbx.aliyun.com/v1
kind: PolarDBXCluster
metadata:
  name: pxc-restore   
spec:
  topology:                         
    nodes:
      cn:
        template:
          image: polardbx/polardbx-sql:v2.4.0_5.4.19
      dn:
        template:
          image: polardbx/polardbx-engine:v2.4.0_8.4.19
  restore:                          
    backupset: pxcbackup-test
    syncSpecWithOriginalCluster: false

Parameter Explanation

  • topology: Instance specifications, refer to Instance Creation
  • restore.backupset: Backup set (backup object) name
  • restore.syncSpecWithOriginalCluster( this parameter is only applicable to version 1.4.0 and subsequent versions ): Whether to keep the instance specifications consistent with the original instance, the default value is false, meaning not consistent; currently, heterogeneous cluster restoration is not supported, meaning the number of data nodes will be forced to remain consistent with the original instance

Restore from Backup Set Files

This method is supported for backup sets created in version 1.4.0 and later. You just need to ensure the backup files still exist in remote storage.

apiVersion: polardbx.aliyun.com/v1
kind: PolarDBXCluster
metadata:
  name: pxc-restore 
spec:
  topology:
    nodes:
      cn:
        template:
          image: polardbx/polardbx-sql:v2.4.0_5.4.19
      dn:
        template:
          image: polardbx/polardbx-engine:v2.4.0_8.4.19
  restore:                  
    from:
      backupSetPath: /polardbx/backup/pxcbackup-test
    storageProvider:  
      storageName: sftp
      sink: default
    syncSpecWithOriginalCluster: false

Parameter Explanation

  • topology: Instance specifications, refer to Instance Creation.
  • restore.from.backupSetPath: Remote storage path of the backup set.
  • restore.storageProvider: Storage configuration used for the backup, refer to 可参照Cluster Backup.
  • restore.syncSpecWithOriginalCluster( this parameter is only applicable to version 1.4.0 and subsequent versions ): Whether to keep the instance specifications consistent with the original instance, the default value is false, meaning not consistent; currently, heterogeneous cluster restoration is not supported, meaning the number of data nodes will be forced to remain consistent with the original instance

Refer to the examples above to write the yaml file for recovery, note that the creation method specified should be restore, and perform the recovery with the following command:

kubectl apply -f pxc-restore.yaml

The recovery progress can be observed with the following command:

kubectl get pxc

Once the PHASE in the status becomes RUNNING, the entire recovery process is complete.

NAME          GMS   CN    DN    CDC   PHASE     DISK       AGE
pxc-restore   1/1   1/1   2/2   1/1   Running   20.3 GiB   22m

Notes

  • rapid recovery operation only requires specifying the desired images in the yaml file, otherwise, the default images will be used; more specification configurations can be found in Cluster Creation.
  • The current recovery function only supports homogenous recovery and does not support a change in the number of nodes.

results matching ""

    No results matching ""