sne*_*hab 2 amazon-s3 amazon-ec2 amazon-web-services amazon-glacier
我试图将 S3 存储桶中的所有文件复制到 VM 中的本地文件夹,但出现以下错误:
warning: Skipping file s3://bucket/object. Object is of storage class GLACIER.
Unable to perform download operations on GLACIER objects. You must restore the
object to be able to perform the operation. See aws s3 download help for
additional parameter options to ignore or force these transfers.
Run Code Online (Sandbox Code Playgroud)

要将文件从我的 S3 存储桶复制到本地文件夹,我使用了以下命令:
aws s3 cp s3://${s3Location} ${localDumpPath}
Run Code Online (Sandbox Code Playgroud)
在哪里:
${s3Location} = 我的 s3 位置和${localDumpPath} = 我的本地文件夹路径我需要更改什么才能成功复制?
问题:您正在尝试复制 aws s3 对象,但存储类型是冰川,并且出现以下错误:
warning: Skipping file s3://<SomePathToS3Object> Object is of storage class GLACIER.
Unable to perform download operations on GLACIER objects.
You must restore the object to be able to perform the operation.
See aws s3 download help for additional parameter options to ignore or force these transfers.
Run Code Online (Sandbox Code Playgroud)
说明:Amazon S3 Glacier是一种安全、持久且成本极低的云存储服务,用于数据归档和长期备份。当您需要使用执行恢复请求的文件时,您需要支付检索价格,几个小时后对象就会启用并准备就绪。当这些数据很少被消耗时,该功能通常使用公司来归档文件/日志/数据库/备份。
解决方案:为了获取冰川文件,您需要启动恢复请求,监视恢复请求的状态,一旦完成就更改存储类(标准)的对象并复制它。您可以使用aws参考
//Initate restore request:
$ aws s3api restore-object --bucket examplebucket --key dir1/example.obj \
--restore-request '{"Days":7,"GlacierJobParameters":{"Tier":"Standard"}}'
//monitor status:
$ aws s3api head-object --bucket examplebucket --key dir1/example.obj
// output example - restore in progress
{
"Restore": "ongoing-request=\"true\"",
...
"StorageClass": "GLACIER",
"Metadata": {}
}
// output example - restore completed
{
"Restore": "ongoing-request=\"false\", expiry-date=\"Sun, 1 January 2000 00:00:00 GMT\"",
...
"StorageClass": "GLACIER",
"Metadata": {}
}
$ aws s3 cp s3://examplebucket/dir1/ ~/Downloads \
--storage-class STANDARD --recursive --force-glacier-transfer
Run Code Online (Sandbox Code Playgroud)
我使用以下命令解决了这个问题:
aws s3 cp s3://${s3Location} ${localDumpPath} --storage-class STANDARD --recursive --force-glacier-transfer
Run Code Online (Sandbox Code Playgroud)
您还可以参考以下链接以获取有关如何使用 AWS CLI 从 Amazon S3 Glacier 存储类 还原 S3 对象的详细信息:从 Amazon Glacier 存储类还原 S3 对象
| 归档时间: |
|
| 查看次数: |
2067 次 |
| 最近记录: |