Create a Backup
Backups in Longhorn are objects in an off-cluster backupstore. A backup of a snapshot is copied to the backupstore, and the endpoint to access the backupstore is the backup target. For more information, see this section.
Prerequisite: A backup target must be set up. For more information, see Set the BackupTarget. If the BackupTarget has not been set, you’ll be presented with an error.
To create a backup,
Result: The backup is created. To see it, click Backup in the top navigation bar.
For information about restoring a volume from a snapshot, see Restore from a Backup.
Example:
apiVersion: longhorn.io/v1beta2
kind: Backup
metadata:
name: backup-example
namespace: longhorn-system
spec:
backupMode: incremental
snapshotName: snapshot-name-example
labels:
app: test
By default, Longhorn backs up only data that was changed since the last backup. This approach, known as delta backup, enhances time efficiency and conserves network throughput. However, when a data block in the backupstore becomes corrupted, Longhorn does not replace that data block with a healthy one during subsequent backup operations.
Starting with v1.7.0, Longhorn can perform full backups that upload all data blocks in the volume and overwrite existing data blocks in the backupstore.
Example:
apiVersion: longhorn.io/v1beta2
kind: Backup
metadata:
name: backup-example
namespace: longhorn-system
spec:
backupMode: full
snapshotName: snapshot-name-example
labels:
app: test
To facilitate collection of data transfer information for each backup, Longhorn records the information using two metrics in the CR status.
status.newlyUploadDataSize
records the size of data that was uploaded for the first time to the backupstore during the latest backup. In other words, it tracks the size of data blocks that did not previously exist in the backupstore.
status.reUploadDataSize
records the size of data that was overwritten during the latest full backup. In other words, it tracks the size of data blocks that previously existed in the backupstore.
© 2019-2024 Longhorn Authors | Documentation Distributed under CC-BY-4.0
© 2024 The Linux Foundation. All rights reserved. The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our Trademark Usage page.