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.
-
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>'};
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>;
For a complete list of backup store settings, see CREATE BACKUP STORE. |
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
.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>'};
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
. -
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
-
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>'};
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;
For a complete list of backup store settings, see CREATE BACKUP STORE. |
Create an 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>'};
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>;
For a complete list of backup store settings, see CREATE BACKUP STORE. |
Create 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 '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.
-
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:
|
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 |
Create backup store with customized retention policy using 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>};
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>;
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
-
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>;
For a complete list of backup store settings, see CREATE BACKUP STORE. |
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>;
Backup stores that are associated with backup configurations cannot be dropped.
-
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.