Skip to content
logo
Percona XtraBackup
Use the xbcloud binary with Swift
Initializing search
    percona/pxb-docs
    percona/pxb-docs
    • Home
      • About Percona XtraBackup
      • How Percona XtraBackup works
      • Understand version numbers
      • Install Percona XtraBackup 8.0
      • Use an APT repo to install Percona XtraBackup
      • Use a YUM repo to install Percona XtraBackup
      • Use DEB or RPM downloaded packages to install Percona XtraBackup
      • Install Percona XtraBackup from a Binary Tarball
      • Compile and install Percona XtraBackup from source code
      • What’s in the packages
      • Uninstall Percona XtraBackup
      • Run Percona XtraBackup in a Docker container
      • Implementation details
      • Connection and privileges needed
      • Configure xtrabackup
      • Server version and backup version comparison
      • xtrabackup exit codes
      • The backup cycle - full backups
      • Incremental backup
      • Compressed backup
      • Partial backups
      • Percona XtraBackup user manual
      • Throttling backups
      • Encrypted InnoDB tablespace backups
      • Encrypt backups
      • LRU dump backup
      • Point-in-time recovery
      • Smart memory estimation
      • Work with binary logs
      • Improved log statements
      • Work with SELinux
      • Work with AppArmor
      • Enable the server to communicate via TCP/IP
      • Install and configure an SSH server
      • Analyze table statistics
      • FLUSH TABLES WITH READ LOCK option
      • lock-ddl-per-table option improvements
      • Take an incremental backup using page tracking
      • The xbcloud binary
      • Use the xbcloud binary with Swift
        • Create a full backup with Swift
        • Restore with Swift
        • Command-line options
          • --storage(=[swift|s3|google])
          • --swift-auth-url()
          • --swift-storage-url()
          • --swift-user()
          • --swift-key()
          • --swift-container()
          • --parallel(=N)
          • --cacert()
          • --insecure()
          • Swift authentication options
          • --swift-auth-version()
          • --swift-tenant()
          • --swift-tenant-id()
          • --swift-region()
          • --swift-password()
          • --swift-user-id()
          • --swift-project()
          • --swift-project-id()
          • --swift-domain()
          • --swift-domain-id()
      • Use xbcloud Binary with Amazon S3
      • Xbcloud with an IAM instance profile
      • Use the xbcloud binary with MinIO
      • Use the xbcloud with Google Cloud Storage
      • Exponential backoff
      • Use the xbcloud binary with Microsoft Azure Cloud Storage
      • How-tos and recipes
      • Release notes index
      • Percona XtraBackup 8.0.31-24 (2023-02-07)
      • Percona XtraBackup 8.0.30-23 (2022-11-14)
      • Percona XtraBackup 8.0.29-22 (2022-07-19)
      • Percona XtraBackup 8.0.28-21 (2022-05-25)
      • Percona XtraBackup 8.0.28-20
      • Percona XtraBackup 8.0.27-19
      • Percona XtraBackup 8.0.26-18.0
      • Percona XtraBackup 8.0.25-17.0
      • Percona XtraBackup 8.0.23-16.0
      • Percona XtraBackup 8.0.22-15.0
      • Percona XtraBackup 8.0.14
      • Percona XtraBackup 8.0.13
      • Percona XtraBackup 8.0.12
      • Percona XtraBackup 8.0.11
      • Percona XtraBackup 8.0.10
      • Percona XtraBackup 8.0.9
      • Percona XtraBackup 8.0.8
      • Percona XtraBackup 8.0.7
      • Percona XtraBackup 8.0.6
      • Percona XtraBackup 8.0.5
      • Percona XtraBackup 8.0.4
      • Percona XtraBackup 8.0-3-rc1
      • Error Message: Found tables with row versions due to INSTANT ADD/DROP columns
      • The xtrabackup option reference
      • The xbcrypt binary
      • The xbstream binary
      • Frequently asked questions
      • Glossary
      • Index of files created by Percona XtraBackup
      • Trademark policy
      • Copyright and licensing information
      • Version checking

    • Create a full backup with Swift
    • Restore with Swift
    • Command-line options
      • --storage(=[swift|s3|google])
      • --swift-auth-url()
      • --swift-storage-url()
      • --swift-user()
      • --swift-key()
      • --swift-container()
      • --parallel(=N)
      • --cacert()
      • --insecure()
      • Swift authentication options
      • --swift-auth-version()
      • --swift-tenant()
      • --swift-tenant-id()
      • --swift-region()
      • --swift-password()
      • --swift-user-id()
      • --swift-project()
      • --swift-project-id()
      • --swift-domain()
      • --swift-domain-id()

    Use the xbcloud binary with Swift¶

    Create a full backup with Swift¶

    The following example shows how to make a full backup and upload it to Swift.

    $ xtrabackup --backup --stream=xbstream --extra-lsndir=/tmp --target-dir=/tmp | \
    xbcloud put --storage=swift \
    --swift-container=test \
    --swift-user=test:tester \
    --swift-auth-url=http://192.168.8.80:8080/ \
    --swift-key=testing \
    --parallel=10 \
    full_backup
    

    The following OpenStack environment variables are also recognized and mapped automatically to the corresponding swift parameters (--storage=swift):

    • OS_AUTH_URL

    • OS_TENANT_NAME

    • OS_TENANT_ID

    • OS_USERNAME

    • OS_PASSWORD

    • OS_USER_DOMAIN

    • OS_USER_DOMAIN_ID

    • OS_PROJECT_DOMAIN

    • OS_PROJECT_DOMAIN_ID

    • OS_REGION_NAME

    • OS_STORAGE_URL

    • OS_CACERT

    Restore with Swift¶

    $ xbcloud get [options] <name> [<list-of-files>] | xbstream -x
    

    The following example shows how to fetch and restore the backup from Swift:

    $ xbcloud get --storage=swift \
    --swift-container=test \
    --swift-user=test:tester \
    --swift-auth-url=http://192.168.8.80:8080/ \
    --swift-key=testing \
    full_backup | xbstream -xv -C /tmp/downloaded_full
    
    $ xbcloud delete --storage=swift --swift-user=xtrabackup \
    --swift-password=xtrabackup123! --swift-auth-version=3 \
    --swift-auth-url=http://openstack.ci.percona.com:5000/ \
    --swift-container=mybackup1 --swift-domain=Default
    

    Command-line options¶

    xbcloud has the following command line options:

    --storage(=[swift|s3|google])¶

    Cloud storage option. xbcloud supports Swift, MinIO, and AWS S3. The default value is swift.

    --swift-auth-url()¶

    URL of Swift cluster.

    --swift-storage-url()¶

    xbcloud will try to get object-store URL for given region (if any specified) from the keystone response. One can override that URL by passing –swift-storage-url=URL argument.

    --swift-user()¶

    Swift username (X-Auth-User, specific to Swift)

    --swift-key()¶

    Swift key/password (X-Auth-Key, specific to Swift)

    --swift-container()¶

    Container to backup into (specific to Swift)

    --parallel(=N)¶

    Maximum number of concurrent upload/download requests. Default is 1.

    --cacert()¶

    Path to the file with CA certificates

    --insecure()¶

    Do not verify servers certificate

    Swift authentication options¶

    Swift specification describes several authentication options. xbcloud can authenticate against keystone with API version 2 and 3.

    --swift-auth-version()¶

    Specifies the swift authentication version. Possible values are: 1.0 - TempAuth, 2.0 - Keystone v2.0, and 3 - Keystone v3. Default value is 1.0.

    For v2 additional options are:

    --swift-tenant()¶

    Swift tenant name.

    --swift-tenant-id()¶

    Swift tenant ID.

    --swift-region()¶

    Swift endpoint region.

    --swift-password()¶

    Swift password for the user.

    For v3 additional options are:

    --swift-user-id()¶

    Swift user ID.

    --swift-project()¶

    Swift project name.

    --swift-project-id()¶

    Swift project ID.

    --swift-domain()¶

    Swift domain name.

    --swift-domain-id()¶

    Swift domain ID.

    Contact us

    For free technical help, visit the Percona Community Forum.

    To report bugs or submit feature requests, open a JIRA ticket.

    For paid support and managed or consulting services , contact Percona Sales.


    Last update: 2022-12-06
    Percona LLC and/or its affiliates, © 2023
    Made with Material for MkDocs

    Cookie consent

    We use cookies to recognize your repeated visits and preferences, as well as to measure the effectiveness of our documentation and whether users find what they're searching for. With your consent, you're helping us to make our documentation better.