CREATE BACKUP STORE
Creates a new backup store. Backup stores can be created using different storage classes: local file storage, Amazon S3 storage, or Google Cloud storage. Depending upon the storage class, different collections of settings are required.
Synopsis
CREATE BACKUP STORE <store_name>
USING '<store_class_name>'
WITH SETTINGS = <settings> ;
Syntax legend
| Syntax conventions | Description |
|---|---|
UPPERCASE |
Literal keyword, unless bold.
If bold, it is a variable.
For example, |
Lowercase |
Not literal |
|
Often represents a variable placeholder that you must replace with a user-defined value. However, angle brackets are also required to surround data types in a set, list, map, or tuple. |
|
Optional command arguments. Do not type the square brackets. |
|
A group of options you can choose from. Do not type the parentheses. |
|
Separates alternative elements when you can choose one of several elements. Type any one of the elements. Do not type the vertical bar. |
|
A repeatable syntax element. Can be reused as often as required. |
|
Single quotation marks must surround literal strings in CQL statements, such as Additionally, single quotation marks are used in Search CQL to surround an entire XML schema declaration.
For example: |
|
Curly braces enclose map collections or key value pairs. A colon separates the key and the value. |
Angle brackets enclose data types in a set, list, map, or tuple. Separate the data types with a comma. |
|
|
Marks the end of a CQL statement. |
|
Separate command line options from command arguments with two hyphens. This syntax is useful when arguments might be mistaken for command line options. |
|
Search CQL only: Identify the entity and literal value to overwrite the XML element in the schema and solrConfig files. |
- store_name
-
Name of the backup store. Store names can use alphanumeric characters and underscores only. They are case insensitive.
- store_class_name
-
Name of the backup store class for the backup store:
-
FSBlobStore: Local (node) or NFS file system storage. -
S3BlobStore: Amazon Web Services (AWS) S3 or compatible storage. -
AzureBlobStore: Microsoft Azure storage. -
GoogleCloudBlobStore: Google cloud storage. -
CompositeStore: A store comprising multiple backup store types used to back up separate datacenters to separate backup stores.
-
- settings
-
A key/value list of settings particular to the store class. For example, for an
FSBlobStoreclass:settings = {'path':'/path/to/data', 'retention_time':'1w'}-
Common settings for all store classes: The following optional settings can be used with any store class.
-
transfer_rate_limit_mbs(int): Maximum upload rate per node in MB per second. Not supported for theCompositeStoreclass. -
retention_time(duration): Time duration for which a snapshot is retained. Can be used alone or withretention_number. If set to0, this parameter is ignored. For example, to retain snapshots for one week, set'retention_time':'1w'. -
retention_number(int): Minimum number of snapshots retained. Can be used alone or withretention_time. If set to0, this parameter is ignored. For example, to retain a minimum of three snapshots, set'retention_number':3.If both
retention_timeandretention_numberare set, the retention time only applies if there are more thanretention_numbersnapshots.For example, assume you set
'retention_time':'1w', 'retention_number':3, and there are only two backups in the last week. In order to meet theretention_number, both current backups are retained in addition to the most recent backup that is older than one week.Any partial backups with a status of
INCOMPLETEorQUORUMthat occur between full backups are also retained.
-
-
FSBlobStoreclass settings: For theFSBlobStoreclass, you must include thepathsetting. This is a text value that specifies the path where snapshots are stored. The target directory must already exist. -
AzureBlobStoreclass settings: The following settings are applicable to theAzureBlobStoreclass only. All are required.-
container(text): Azure container in which snapshots are stored. -
endpoint(text): Azure endpoint or Azure account name. -
sas_token(text): Azure Shared Access Signature (SAS) token. Not required if using the Azure Managed Identity authentication mechanism.
-
-
GoogleCloudBlobStoreclass settings: The following settings are applicable to theGoogleCloudBlobStoreclass only:-
bucket(text): Required. Google Cloud bucket in which snapshots are stored. -
project_id(text): Optional. Project ID associated with the Google Cloud bucket. -
endpoint(text): Optional. Google Cloud Endpoint. -
client_email(text): Email address associated with the Google Cloud account. Required only ifprivate_keyis set. -
client_id(text): Optional. Client ID associated with the Google Cloud account. -
private_key(text): Private key associated with the Google Cloud account. Required only ifclient_emailis set. -
private_key_id(text): Optional. Private key ID of theprivate_keyassociated with the Google Cloud account.If no credentials are set in the
GoogleCloudBlobStoresettings, then the Application Default Credentials (ADC) are used. To find credentials, ADC checks if the environment variableGOOGLE_APPLICATION_CREDENTIALSis set. If it is set, ADC uses the referenced service account file. If it isn’t set, ADC uses the default service account provided by the Compute Engine, Kubernetes Engine, App Engine, or Cloud Functions, depending on the environment on which the application is running. If no credentials are found, an error occurs.
-
-
S3BlobStoreclass settings: The following settings are applicable to only theS3BlobStoreclass.-
bucket(text): Required. AWS bucket in which snapshots are stored. -
region(text): AWS region, an alternative to theendpointsetting. Required ifendpointis not set. -
endpoint(text): Endpoint for the AWS S3 server, an alternative to theregionsetting. Required ifregionis not set. -
default_socket_timeout(int): Optional. Socket timeout in ms. Default: 50,000. -
max_error_retry(int): Optional. Maximum retries when an error occurs. Default: 3. -
default_throttle_retries(Boolean): Optional. Whether to enable retry throttling. Default: true. -
server_side_encryption(Boolean): Optional. Whether to enable server-side encryption (AES256). Default: true. -
accelerated_mode_enabled(Boolean): Optional. Whether to enable AWS transfer acceleration. Only applicable to AWS S3. Default: false. -
storage_class(text): Optional. Storage class in which Binary Large Objects (BLOBS) are stored. -
canned_acl(text): Optional. Access Control List (ACL) for buckets and objects. -
access_key(text): Optional. Access key used for authentication. -
secret_key(text): Optional. Secret key used for authentication.If no authentication details are specified in the
S3BlobStoresettings, theDefaultAWSCredentialsProviderChainis used. TheDefaultAWSCredentialsProviderChainsearches for credentials by first checking the environment variablesAWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEY. If these aren’t set, it checks the Java system propertiesaws.accessKeyIdandaws.secretKey. If it still doesn’t find credentials, it checks for a credential profile located at~/.aws/credentials. If no profile is found, it checks for credentials provided through the Amazon EC2 container service if theAWS_CONTAINER_CREDENTIALS_RELATIVE_URIenvironment variable is set and the security manager has permission to access that variable. If none of these methods provide credentials, it checks for instance profile credentials delivered using the Amazon EC2 metadata service.
-
-
CompositeStoreclass settings: For theCompositeStoreclass, you must include thedata-center-namesetting. This setting accepts a key-value pair where the key is a valid DSE datacenter name and the value is an existing configured backup store (one ofFSBlobStore,AzureBlobStore,GoogleCloudBlobStore, orS3BlobStore).
-
Examples
Create a local file system backup store with defaults:
CREATE BACKUP STORE fs_store_1
USING 'FSBlobStore' WITH settings = {'path':'/my/local/path'};
Create a Google backup store:
CREATE BACKUP STORE google_store
USING 'GoogleBlobStore' WITH settings = {'bucket': 'my_google_bucket'};
Create an Amazon S3 backup store with a custom retention period and number of backups:
CREATE BACKUP STORE s3_store
USING 'S3BlobStore' WITH settings = {'bucket': 'my_s3_bucket',
'region': 'us-west-1',
'retention_time':'1w',
'retention_number' : 4};
Create a composite backup store:
CREATE BACKUP STORE composite_store
USING 'CompositeBlobStore' WITH settings = {'DC1': 'fs_store_1', 'DC2': 's3_store'};