gpt4 book ai didi

amazon-web-services - 借助 Amazon S3 智能分层,您如何知道对象位于哪一层?

转载 作者:行者123 更新时间:2023-12-05 00:44:07 25 4
gpt4 key购买 nike

https://docs.aws.amazon.com/AmazonS3/latest/userguide/archived-objects.html说:

When you archive Amazon S3 objects to the S3 Glacier or S3 GlacierDeep Archive storage class, or when objects are archived to the S3Intelligent-Tiering Archive Access or Deep Archive Access tiers, theobjects are not accessible in real time.

我明白这一点,但您如何判断对象是在存档访问层还是深度存档访问层?我浏览了大部分 AWS S3 文档,但似乎找不到这些信息。我正在为 S3 编写 UI,并希望根据对象所在的层显示“下载”或“恢复”按钮。我刚刚开始开发,所以我没有任何文件两层,我等不及要等 90 天才能搬到那里。

当您执行 list-objects 请求时,您将获得每个项目的存储类,它以 INTELLIGENT_TIERING 的形式返回,但它不会告诉您是哪一层是的。

Testing S3 Intelligent Tiering 的评论说你可以通过将存储类更改为 Glacier 来伪造它,但我怀疑这是一个准确的测试,因为 Glacier 和 Intelligent Tiering 是两个不同的存储类,Intelligent Tiering 对象会突然改变它们是没有意义的存储类。

有人有什么见解吗?提前致谢。

来自亚马逊的更新:(tl;dr,这是不可能的)

Unfortunately we cannot identify the access tier for an object stored in Intelligent Tiering class the only way to determine the access tier of an object in by identifying the access pattern of an object. The access pattern can be identified either by analyzing AccessLogs or a user can review access pattern using S3 Storage Lens.

Based on your requirement, the best option for you would be to keep Intelligent-Tiering Archive configuration disabled. With this config disabled the objects in Intelligent-Tiering class will not move in "Archive Access tier" and "Deep Archive Access tier". With this configuration you can create a logic in your application that if the object is in class "Intelligent-Tiering" then the download button will be enabled and user will be able to download the object.

Now for moving objects to "Glacier" and "Glacier Deep Archive" you can configure a life cycle rule. Lets say you can configure a life cycle rule to transition objects in "Intelligent-Tiering" class to Glacier after 90 days and to "Glacier Deep Archive" after 180 days.

This way using ListObjects API call you can identify the correct storage class of the objects and you can program a logic where the "Restore" button will only be enabled if the storage class is "Glacier" or "Glacier Deep Archive". Appropriately a message will be displayed to users to download the object after 3-5 hours.

最佳答案

@howcheng 你可以使用S3 Inventory获取所有对象及其相应元数据的列表,包括 S3 智能分层访问层(频繁、不频繁、存档、深度存档)。 Amazon S3 Inventory 提供 CSV、ORC 或 Parquet 输出文件,这些文件每天或每周为 S3 存储桶或共享前缀列出您的对象及其对应的元数据。您也可以制作 HEAD request在您的对象上报告 S3 智能分层归档访问层。

关于amazon-web-services - 借助 Amazon S3 智能分层,您如何知道对象位于哪一层?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68027379/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com