5.2 Backup Routines for the Data Repository

This section describes the backup routines for the Data Repository, how to backup and restore the system as well as the daily and weekly maintenance tasks that you are recommended to perform.


Backups for Couchbase

For performance, Couchbase mainly stores and retrieves information for clients using RAM. Eventually, it stores all data to disk to provide a higher level of reliability. If a node fails and the cached data is lost, you can still recover items from disk. This enables you to perform backup and restore operations.

The Couchbase Commandline interface for administration includes the cbbackup Tool for making backups, which creates a copy of data from an entire running cluster, an entire bucket, a single node, or a single bucket on a single functioning node.

To make a backup of Couchbase:

  1. Enter the /bin/cbbackup directory of your Couchbase installation.

  2. Run the following command:

    $ cbbackup [options] [source] [backup-dir] -u [admin] -p [password]

    The source is a URL to the cluster/node/ directory that you want to back up and the backup-dir is the directory where you want to store the data.

    Example - Couchbase Backup

    $ cbbackup http://HOST:8091 /backup-42 -u Administrator -p password
    $ cbbackup http://HOST:8091 /backup-42 -m diff -u Administrator -p password
    $ cbbackup http://HOST:8091 /backup-42 -m diff -u Administrator -p password

    The stated cluster/node/ directory will now be backed up. 

    There are also several other options you can use with this command, see https://developer.couchbase.com/documentation/server/5.1/backup-restore/backup-restore.html.


Backups and Backup Schedules for MySQL Cluster

Backup schedules can be created from the CMON web interface, located at http://<[CZ] host name or IP address>/cmon, or by using a command line:


Making a backup from the Web Interface

To create a backup schedule using the CMON web interface:

  1. In the CMON Monitoring Dashboard, click on the cluster you want to make a backup for in the menu to the left.
     

  2. Click on the Backups option in the menu to the right.

    The Backup Management page is displayed.

    CMON Backup Management

  3. If you want to start a backup immediately, click on the backup button.

    The Preparing: Start Backup dialog opens.

    CMON Preparing Backup

  4. Change the path to the backup directory if you want to save the backup somewhere else than in the default directory, otherwise click on the Proceed button to start the backup.

    The Executed: Backup dialog opens displaying information about the backup.
     

  5. Click on the Close button to close the dialog and return to the Backup Management page.
     

  6. If you want to set up scheduled backups, select the check boxes for the days you want backups to be made, enter at what time you want the backup to be made, enter the path to the directory where you want to save the backup and click on the schedule button.

    You will then see a message that the backup schedule was added successfully.


Making a backup with the command line tool

To start a backup using a command line tool:

  1. Start a command line tool and go to the scripts directory:

    $ cd mysqlcluster-71/cluster/scripts

      

  2. Run the script for starting the backup:

    $ ./start-backup.sh /<path to the directory where you want to save the backup files>

Restoring Backups

To restore a backup using a command line tool:

  1. Start a command line tool and go to the scripts directory:

    $ cd mysqlcluster-71/cluster/scripts

     

  2. Run the script for restoring a backup:

    $ ./restore-backup.sh --backupdir=/<path to the directory where the backup is stored, including the actual backup directory>

Backup and Maintenance for Redis

You can specify how you want to back up and maintain your Redis cluster via the Advanced Settings in your ElastiCache Dashboard. 

Dialog to configure backup and maintenence for ElastiCache

Alternatively, you can do a manual backup by selecting the Backup button in the ElastiCache Dashboard.

For further information, see https://aws.amazon.com/documentation/elasticache/.

Next chapter: