Creating and managing backup stores (beta)

Create and manage DSE Backup and Restore Service backup stores.

Important: The DSE Backup and Restore Service is currently in beta and is intended to be used by users provisioning DSE via the DataStax Cass Operator in a Kubernetes cluster.
Before you can run a backup, you must create a backup store. A backup store comprises the following information:
  • A backup store name. Backup store names can use alphanumeric characters and underscores only. They are case insensitive.
  • A backup store storage class:
    • FSBlobStore: Local node or NFS file system storage.
    • S3BlobStore: Amazon Web Services (AWS) S3 or compatible storage.
    • GoogleCloudBlobStore: Google cloud storage.
  • A list of configuration settings particular to the storage class.
    Tip: For a complete list of backup store settings, see CREATE BACKUP STORE (beta).

Create a file system backup store

You can store backups on a local node or NFS mounted file systems. This is the simplest backup store class, but is also directly dependent upon your storage infrastructure for fault tolerance.

To create a file system backup store:

  1. Create a local directory or mount an NFS directory.
  2. Start cqlsh and create a backup store replacing store_name with a name for the backup store, and /full_path with the directory you created:
    CREATE BACKUP STORE store_name
    USING 'FSBlobStore' WITH settings = {'path':'/full_path'};
    Important: Store names can use alphanumeric characters and underscores only. They are case insensitive.
  3. Verify that the backup store was created successfully and contains no errors:
    VERIFY BACKUP STORE store_name;
Note: For a complete list of backup store settings, see CREATE BACKUP STORE (beta).

Create a Google Cloud backup store

To create a Google Cloud backup store:

  1. Note the name of the Google Cloud bucket in which you want to store backups..
  2. Start cqlsh and create a backup store replacing store_name with a name for the backup store, and google_bucket_name with name of your Google Cloud bucket:
    CREATE BACKUP STORE store_name 
    USING 'GoogleCloudBlobStore' WITH settings = {'bucket': 'google_bucket_name'};
    Important: Store names can use alphanumeric characters and underscores only. They are case insensitive.
  3. Verify that the backup store was created successfully and contains no errors:
    LIST BACKUP STORES;
    
     name       | class                                                         | settings
    ------------+---------------------------------------------------------------+--------------------------
     store_name | com.datastax.bdp.db.backups.destinations.GoogleCloudBlobStore | {'bucket': 'google_bucket_name'}
Note: For a complete list of backup store settings, see CREATE BACKUP STORE (beta).

Create an Amazon S3 backup store

To create a Amazon S3 backup store:

  1. Note the name of the Amazon S3 bucket in which you want to store backups.
  2. Start cqlsh and create a backup store replacing store_name with a name for the backup store, amazon_bucket_name with name of your Amazon S3 bucket, and amazon_region with the Amazon S3 region:
    CREATE BACKUP STORE store_name 
    USING 'S3BlobStore' WITH settings = {'bucket': 'amazon_bucket_name',
                                                  'region': 'amazon_region'};
    Important: Store names can use alphanumeric characters and underscores only. They are case insensitive.
  3. Verify that the backup store was created successfully and contains no errors:
    VERIFY BACKUP STORE store_name;
Note: For a complete list of backup store settings, see CREATE BACKUP STORE (beta).

Customize backup retention policy

For each store you create, you can customize the number of backups retained as well as the retention duration using the following backup store settings:

  • retention_time: time duration for which a snapshot is retained.
  • retention_number: number of snapshots retained.

When retention_number is set to 0, retention_time determines how long a backup is retained before it is purged. For example, setting 'retention_time':'1w' purges any backup older than one week. Any non-full backup with a status of INCOMPLETE or QUORUM that occurs between the full backups is retained as well.

Likewise, when retention_time is set to 0, retention_number determines only the specified number of backups that are retained at any time. For example, 'retension_number':3 purges the oldest backup once the limit of three is met. Any non-full backup with a status of INCOMPLETE or QUORUM that occurs between the full backups is retained as well.

When retention_time and retention_number are combined, a minimum of snapshots equal to the retention_number are retained for the retension_time. For example, 'retention_time':'1w','retention_number':3 retains a minimum of three backups during the one week retention period, even if any of the backups are older than one week.
Important: If, for example, there happen to be four full backups within the retention_time window, all four are retained. If there are only two backups, however, the last backup older than the retention_time window will also be retained. In addition, any non-full backup with a status of INCOMPLETE or QUORUM that occurs between the full backups is retained as well.

To create a backup store with a customized retention policy using the FSBlobStore class:

  1. Create a local directory or mount an existing NFS directory.
  2. Start cqlsh and create a backup store replacing store_name with a name for the backup store, and /full_path with the directory you created, a time duration for retention_time (for example, 1w for one week, 1m for one month), and the number of backups to be retained for the duration:
    CREATE BACKUP STORE store_name
    USING 'FSBlobStore' WITH settings = {'path':'/full_path'
                                         'retention_time':'duration',
                                         'retention_number': number};
    Important: Store names can use alphanumeric characters and underscores only. They are case insensitive.
  3. Verify that the backup store was created successfully and contains no errors:
    VERIFY BACKUP STORE store_name;
Note: For a complete list of backup store settings, see CREATE BACKUP STORE (beta).

Alter and drop backup stores

You can alter existing backup store configurations and drop backup stores you no longer need.

To modify a backup store:

  1. List the existing backup stores to find the one you want to modify:
    LIST BACKUP STORES;
    
     name       | class                                                | settings
    ------------+------------------------------------------------------+-----------------------------------------
     store_name | com.datastax.bdp.db.backups.destinations.FSBlobStore | {'path': 'full_path'}
  2. Alter the backup store configuration as required:
    ALTER BACKUP STORE store_name WITH settings=settings;
Note: For a complete list of backup store settings, see CREATE BACKUP STORE (beta).

To drop a backup store:

  1. List the existing backup stores to find the one you want to drop:
    LIST BACKUP STORES;
    
     name       | class                                                | settings
    ------------+------------------------------------------------------+-----------------------------------------
     store_name | com.datastax.bdp.db.backups.destinations.FSBlobStore | {'path': 'full_path'}
  2. List the backup configurations:
    LIST BACKUP CONFIGURATIONS;
    
     name        | target_keyspace | stores            | frequency | enabled | next_execution_time
    -------------+-----------------+-------------------+-----------+---------+---------------------
     config_name | keyspace_name | ['store_name'] | * * * * * |   False |                null
  3. Drop any backup configurations associated with the backup store name:
    DROP BACKUP CONFIGURATION config_name;
    Important: Backup stores that are associated with backup configurations cannot be dropped.
  4. Drop the backup store:
    DROP BACKUP STORE store_name;
    Important: Dropping a backup store does not removed the associated backup data.

What to do next

With the backup store created, continue to Creating and managing backup configurations (beta).