Creating and managing backup stores

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.

    • AzureBlobStore: Microsoft Azure web storage.

    • S3BlobStore: Amazon Web Services (AWS) S3 or compatible storage.

    • GoogleCloudBlobStore: Google cloud storage.

    • CompositeStore: Independent backup stores for each datacenter.

  • A list of configuration settings particular to the storage class.

    For a complete list of backup store settings, see CREATE BACKUP STORE.

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.

  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>'};

    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>;

For a complete list of backup store settings, see CREATE BACKUP STORE.

Create a Microsoft Azure backup store

  1. Note your Azure account name or your Azure endpoint, and the Azure container name in which you want to store your backups. If you are not using Azure Managed Identity, also note the sas_token.

    Your Azure account name can be used in place of the Azure endpoint.

  2. Start cqlsh and create a backup store replacing <store_name> with a name for the backup store:

    CREATE BACKUP STORE <store_name>
    USING 'AzureBlobStore' WITH settings = {'endpoint': '<azure_account_name>',
                                            'container': '<azure_container_name>',
                                            'sas_token': '<azure_sas_token>'};

    Store names can use alphanumeric characters and underscores only. They are case insensitive.

    If you are using Azure Managed Identity, you can omit sas_token.

  3. Verify that the backup store was created successfully and contains no errors:

    VERIFY BACKUP STORE store_name;

For a complete list of backup store settings, see CREATE BACKUP STORE.

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>'};

    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;

For a complete list of backup store settings, see CREATE BACKUP STORE.

Create an 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>'};

    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>;

For a complete list of backup store settings, see CREATE BACKUP STORE.

Create Composite backup store

  1. Create separate backup stores for each of the datacenters you want to back up, for example:

    • us-west-s3: an Amazon S3 backup store for your us-west-dc datacenter.

    • us-east-google: a Google Cloud storage backup store for your us-east-dc datacenter. Tip: You can mix any combination of backup store types:

    • FileSystemBlobStore

    • AzureBlobStore

    • S3BlobStore

    • GoogleCloudBlobStore

  2. Start cqlsh and create a backup store replacing the example keys, us-west and us-east with the name of your datacenters, and the us-west-s3 and us-east-google values with the name of your configured backup stores:

    CREATE BACKUP STORE <store_name>
    USING 'CompositeBlobStore' WITH settings = {'<us-west>': '<us-west-s3>',
                                            '<us-east>: '<us-east-google>'};

    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>;

For a complete list of backup store settings, see CREATE BACKUP STORE.

The following restrictions apply to Composite backup stores:

  • Rate limits are not supported.

  • Keyspaces using the SimpleStrategy replication should not be backed up to a Composite store.

  • Backup stores that are part of a Composite store should not be deleted.

  • Metrics for composite backup stores are currently incomplete.

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.

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.

Create backup store with customized retention policy using 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>};

    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>;

For a complete list of backup store settings, see CREATE BACKUP STORE.

Alter and drop backup stores

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

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>;

For a complete list of backup store settings, see CREATE BACKUP STORE.

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>;

    Backup stores that are associated with backup configurations cannot be dropped.

  4. Drop the backup store:

    DROP BACKUP STORE <store_name>;

    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.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com