Add Backup/Restore support for Couchbase

Backup strategy:
- Save bucket metadata config (as json file) to /tmp/backups
- This is needed on restore to create the destination buckets
- Handles root enabled case by also saving /etc/couchbase/secret_key to /tmp/backups
- Use cbbackup to do the backup
- /tmp/backups will be zipped up, encrypted, and sent to Swift

Restore strategy:
- 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
- Use cbrestore (which requires destination buckets to be manually
  created first) to do the restore
- cbrestore can only restore one bucket at a time

DocImpact
backup_namespace and restore_namespace were in the default conf group, now they are per datastore

Change-Id: Iaf4370dcc978df68e7d01c6f63795eaf50aac89d
Implements: blueprint backups-single-instance-couchbase
This commit is contained in:
Michael Yu
2014-05-06 14:16:05 -07:00
parent 8b35dacab5
commit 61935d3512
11 changed files with 525 additions and 18 deletions

View File

@@ -83,10 +83,8 @@ ignore_users = os_admin
ignore_dbs = lost+found, mysql, information_schema
# Strategy information for backups
backup_namespace = trove.guestagent.strategies.backup.mysql_impl
# Additional commandline options to be passed to the backup runner (by strategy). For example:
# backup_runner_options = InnoBackupEx:--no-lock, MySQLDump:--events --routines --triggers
restore_namespace = trove.guestagent.strategies.restore.mysql_impl
storage_strategy = SwiftStorage
storage_namespace = trove.guestagent.strategies.storage.swift
backup_swift_container = database_backups
@@ -96,4 +94,3 @@ backup_aes_cbc_key = "default_aes_cbc_key"
backup_use_snet = False
backup_chunk_size = 65536
backup_segment_max_size = 2147483648