Trove/backup-restore-single-instance-couchbase
< Trove
Contents
Introduction
This article describes the design and process for backup and restore for Couchbase.
Blueprint
https://blueprints.launchpad.net/trove/+spec/backups-single-instance-couchbase
Future Follow up Blueprints
- Support incremental backup restore for Couchbase
Goals
- Implement backup and restore strategy for Couchbase
Dependencies
- Add support for 'trove root-enable' in Couchbase
- Adds backup/restore support for mongodb
- https://review.openstack.org/#/c/78339/ <-- requires some of the code changes introduced to support backup/restore for different datastores
Description
- Backup strategy
- Backup directory is /tmp/backups
- Save bucket metadata config (json file) as part of backup via:
- curl -u admin:password http://localhost:8091/pools/default/buckets
- This is needed on restore to create the destination buckets
- Handles root enabled cause by also backing up /tmp/secret_key
- Use cbbackup to do the backup
- Only backs up the raw data from Couchbase (membase) buckets. Skips memcached buckets because data is not persistent.
- http://docs.couchbase.com/couchbase-manual-2.5/cb-cli/#cbbackup-tool
- Backup directory (/tmp/backups) will be zipped up, encrypted, and sent to Swift
- If no buckets, backup will error out
- Restore strategy
- Get backup tarball from Swift, decrypt, and untar
- If /tmp/backups/secret_key exists, set root password
- Iterate through bucket metadata config (json file) and use Couchbase REST API to create each bucket
- Wait until bucket finishes creating
- Follows same logic as couchbase-cli bucket-create --wait (because REST API doesn't have anything for "wait")
- Use cbrestore to do the restore
Usage: cbrestore [options] backup_dir destination Restores a single couchbase bucket. Please first create the destination / bucket before restoring. <pre>