Introducing xbcloud: Azure Blob Storage Support in Percona XtraBackup

Mysql

Percona XtraBackup delivers the xbcloud binary – an auxiliary tool to allow users to upload backups to different cloud providers directly.

Today we are glad to announce the support of the Azure Blob storage to xbcloud.

This new feature will allow you to upload/download backups to Azure Blob storage. You would need an Azure storage account and access key. Check out this blog post on how to get one through the Azure portal.

This new functionality is available in the release of Percona XtraBackup 8.0.27 and will be available in Percona XtraBackup 2.4.25.

You can install xbcloud and XtraBackup via the percona-release package configuration tool. See the Percona Documentation for further details.

The Following Options are Added in xbcloud:

Option
Details
–azure-storage-account
Azure storage account.
–azure-container-name
Azure container name.
–azure-access-key
Azure access key.
–azure-endpoint
Azure cloud storage endpoint.
–azure-tier-class
Azure cloud tier for backup.
Hot|Cool|Archive
Xbcloud doesn’t set the default value and the default value depends on the account tier. See azure documentation for more details.
–azure-development-storage

Only to test your backup against azurite emulator
To run against azurite emulator

 It can work with the default credentials provided by azurite. For example, it uses http://127.0.0.1:10000 as the default endpoint, which can be overwritten by –azure-endpoint. Users can also  provide –azure-access-key,  –azure-storage-account, –azure-container-name.

Environment Variables

The following environment variables are recognized. xbcloud maps them automatically to corresponding parameters applicable to azure storage.

AZURE_STORAGE_ACCOUNT
AZURE_CONTAINER_NAME
AZURE_ACCESS_KEY
AZURE_ENDPOINT
AZURE_STORAGE_CLASS

Examples of the xbcloud Commands

Backup to xbcloud

xtrabackup –backup –stream=xbstream –target-dir= $TARGET_DIR | xbcloud put backup_name –azure-storage-account=pxbtesting –azure-access-key=$AZURE_KEY –azure-container-name=test –storage=azure

Restore Backup from xbcloud

xbcloud get backup_name  –azure-storage-account=$STORAGE_ACCOUNT –azure-access-key=$AZURE_KEY –azure-container-name=test –storage=azure –parallel=10 2>download.log | xbstream -x -C restore 

Delete Backup from xbcloud

xbcloud delete backup_name –azure-storage-account=$STORAGE_ACCOUNT –azure-access-key=$AZURE_KEY –azure-container-name=test –storage=azure

Shortcut Restore

export AZURE_ACCESS_KEY=$ACCESS_KEY
export AZURE_STORAGE_ACCOUNT=$STORAGE_ACCOUNT
xbcloud get azure://test/backup_name …

You can use all existing options for xbcloud like parallel, max-retries. See more details xbcloud documentation and help section.