To download backups via a sub-account, please grant the sub-account sufficient permissions. For more information, please see Sub-Account Authorization for Backup Download.
SecretKeyon the API Key Management page.
TbecxxxxxxxxxxxT4Yw, region code is
ap-guangzhou, and bucket is
mognodb-backup-test-1251937, then the configuration of COSCMD will be as shown below:
coscmd config -a IKIDxxxxxxxxxxx20Eb -s TbecxxxxxxxxxxxT4Yw -b mognodb-backup-test-1251937 -r ap-guangzhou
Log in to the Linux CVM instance and specify an empty download directory. If there is no empty directory, run the following command to create one:
The private network address of the Linux CVM instance must be within one of the following IP ranges; otherwise, backup files cannot be downloaded.
Run the download command with the download link obtained from the TencentDB for MongoDB Console. For example, if the download link is
cmongo_backup/cmgo-pfsumk5l_0/snapshot/1544517026, the command will be as shown below:
coscmd download -r cmongo_backup/cmgo-pfsumk5l_0/snapshot/1544517026 dump/
- A replica set has only one download link.
- Each shard of a sharded cluster has a download link. Different shards need to be stored in different directories so as to prevent the downloaded data from being overwritten.
-rmust be added to the command for downloading folders.
After the download is completed, you can view the downloaded files as shown below: