Creating and managing backup stores
Create and manage DSE Backup and Restore Service backup stores.
- 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 data center.
- A list of configuration settings particular to the storage class.Tip: 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.
To create a file system backup store:
- Create a local directory or mount an NFS directory.
- 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. - Verify that the backup store was created successfully and contains no
errors:
VERIFY BACKUP STORE store_name;
Create a Microsoft Azure backup store
To create a Microsoft Azure backup store:
- 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
.Tip: Your Azure account name can be used in place of the Azure endpoint. - 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'};
Important: Store names can use alphanumeric characters and underscores only. They are case insensitive.Note: If you are using Azure Managed Identity, you can omitsas_token
. - Verify that the backup store was created successfully and contains no
errors:
VERIFY BACKUP STORE store_name;
Create a Google Cloud backup store
To create a Google Cloud backup store:
- Note the name of the Google Cloud bucket in which you want to store backups..
- 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. - Verify that the backup store was created successfully and contains no
errors:
VERIFY BACKUP STORE store_name;
Create an Amazon S3 backup store
To create a Amazon S3 backup store:
- Note the name of the Amazon S3 bucket in which you want to store backups.
- 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. - Verify that the backup store was created successfully and contains no
errors:
VERIFY BACKUP STORE store_name;
Create Composite backup store
To create a Composite backup store:
- 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 yourus-west-dc
datacenter.us-east-google
: a Google Cloud storage backup store for yourus-east-dc
datacenter.
Tip: You can mix any combination of backup store types:FileSystemBlobStore
AzureBlobStore
S3BlobStore
GoogleCloudBlobStore
- Start cqlsh and create a backup store replacing the example keys,
us-west
andus-east
with the name of your datacenters, and theus-west-s3
andus-east-google
values with the name of your configured backup stores:CREATE BACKUP STORE store_name USING 'CompositeStore' WITH settings = {'us-west': 'us-west-s3', 'us-east: 'us-east-google'};
Important: Store names can use alphanumeric characters and underscores only. They are case insensitive. - Verify that the backup store was created successfully and contains no
errors:
VERIFY BACKUP STORE store_name;
- 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.
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.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:
- Create a local directory or mount an existing NFS directory.
- 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. - Verify that the backup store was created successfully and contains no
errors:
VERIFY BACKUP STORE store_name;
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:
- 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'}
- Alter the backup store configuration as
required:
ALTER BACKUP STORE store_name WITH settings=settings;
To drop a backup store:
- 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'}
- List the backup
configurations:
LIST BACKUP CONFIGURATIONS; name | target_keyspace | stores | frequency | enabled | next_execution_time -------------+-----------------+-------------------+-----------+---------+--------------------- config_name | keyspace_name | ['store_name'] | * * * * * | False | null
- 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. - 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.