ClusterControl Cloud File Manager
This optional package is complimentary of ClusterControl Cloud and is introduced in ClusterControl v1.5. The package name is clustercontrol-clud (an abbreviation of CLoud Upload Download) and is the command-line interface for ClusterControl to interact with the cloud providers when uploading and downloading backups. You can think of it as a cloud file manager. No extra configuration is required.
This package installs the following file:
/usr/sbin/clud– The executable binary file.
This tool is used by ClusterControl in the following scenarios:
- After an on-demand or scheduled database backup has been successfully taken and if it is configured to be uploaded to the cloud, when Upload backup to cloud is toggled on.
- When you want to manually upload an existing backup to the cloud at Backups → choose a backup → Actions → Upload.
- When you want to download an existing backup from the cloud to the host (controller or database node) at Backups → choose a backup → Actions → Download.
Usage
The general synopsis to execute commands using clud is:
Commands
| Name, shorthand | Description |
|---|---|
| upload | Upload a file to the cloud. |
| download | Download a file from the cloud. |
| rm | Delete a file on the cloud. |
| clouds | List supported cloud providers. |
| help, h | Shows a list of commands or help for one command. |
Options
| Name, shorthand | Description |
|---|---|
−−cloud |
Use this cloud for the action. |
−−service |
Use this service within the cloud. |
−−credentials |
Raw credentials JSON. |
−−credentials-file |
Take credentials from this file instead of using STDIN input. |
−−auto-create-bucket |
Use this flag if the bucket should be auto-created if not exists. |
−−help, -h |
Show help. |
−−version |
Print the version. |
Examples
List out the supported cloud providers:
$ clud clouds
SUPPORTED CLOUD PROVIDERS:
aws - Amazon Web Services gce - Google Cloud az - Microsoft Azure s3 - Any S3-Compatible Cloud
Commonly, ClusterControl performs the upload to cloud task by invoking the following command:
/usr/sbin/clud \
--cloud <supported_cloud_provider> \
--credentials-file '<path_to_credential.json>' \
--service unknown \
--auto-create-bucket \
upload <bucket_name> <source_file_path> <destination_file_path_in_cloud>
The following is an example to upload a file to S3-compatible object storage:
$ /usr/sbin/clud --cloud s3 --credentials-file 'mycreds.json' --service unknown --auto-create-bucket upload mybucket1 my_data.sql folder1/my_data.sql
UPLOAD COMPLETE
Bucket: mybucket1
Location: folder1/my_data.sql
Where the content of mycreds.json is: