CREATE-REPOSITORY
Last Updated:2021-10-14
CREATE REPOSITORY
Description
This statement is used to create a repository. Repository is used for backup or recovery. Only admin users can create repository.
CREATE [READ ONLY] REPOSITORY `repo_name`
WITH BROKER `bos`
ON LOCATION `repo_location`
PROPERTIES ("key"="value", ...);
-
READ ONLY
If
READ ONLY
is specified, the repository is read-only, that is, users can only operate recovery and cannot operate backup. -
WITH BROKER
The create operation depends on the Broker service process. After that, the
PROPERTIES
should be filled with information for Broker to access the remote repository. -
ON LOCATION
Specify the path for data storage in remote storage.
Example
-
Create a repository named
bos_repo
, the data root directory is:bos://my_bucket/palo_backup/
CREATE REPOSITORY `bos_repo` WITH BROKER `bos_broker` ON LOCATION "bos://my_bucket/palo_backup/" PROPERTIES ( "bos_endpoint" = "http://gz.bcebos.com", "bos_accesskey" = "069fc2786e664e63a5f111111114ddbs22", "bos_secret_accesskey"="70999999999999de274d59eaa980a" );
Keywords
CREATE, REPOSITORY
Best Practices
- Multiple repositories can be created in a cluster. Only users with ADMIN privileges can create repository.
- Any user can view the repository(ies) created by the SHOW REPOSITORIES command.
- When operating for data migration, it is necessary to create the same repository in the source cluster and the target cluster, so that the data snapshot backed up by the source cluster can be viewed in target cluster through this repository.