Amazon AWS Athena S3 和 Glacier 混合桶

Amazon AWS Athena S3 and Glacier Mixed Bucket

Amazon Athena 日志分析服务与 S3 Glacier

我们在 S3 中有数 PB 的数据。我们是 https://www.pubnub.com/,我们将使用数据存储在我们网络的 S3 中以用于计费目的。我们将制表符分隔的日志文件存储在 S3 存储桶中。雅典娜给我们带来了 HIVE_CURSOR_ERROR 失败。

我们的 S3 存储桶设置为在 6 个月后自动推送到 AWS Glacier。除了 Glacier 备份文件之外,我们的存储桶中还有热的 S3 文件可供读取。因此,我们从 Athena 收到访问错误。错误中引用的文件是 Glacier 备份。

我猜答案是:不要将冰川备份放在同一个桶中。由于我们的数据量大小,我们没有这个选项。我相信 Athena 不会在此设置中工作,我们将无法使用 Athena 进行日志分析。

但是,如果我们有办法使用 Athena,我们会很高兴。是否有 HIVE_CURSOR_ERROR 的解决方案和跳过 Glacier 文件的方法?我们的s3桶是一个扁平的桶没有文件夹

截图中省略了上下截图中显示的S3文件对象名。 HIVE_CURSOR_ERROR 中的文件引用实际上是 Glacier 对象。您可以在我们的 S3 存储桶的屏幕截图中看到它。

请注意,我在 https://forums.aws.amazon.com/ 上尝试 post,但那不是布埃诺。

日期为 2017 年 5 月 16 日的 documentation from AWS 明确指出 Athena 不支持 GLACIER 存储 class:

Athena does not support different storage classes within the bucket specified by the LOCATION clause, does not support the GLACIER storage class, and does not support Requester Pays buckets. For more information, see Storage Classes, Changing the Storage Class of an Object in |S3|, and Requester Pays Buckets in the Amazon Simple Storage Service Developer Guide.

我们也对此感兴趣;如果你让它工作,请告诉我们如何。 :-)

因为 the release of February 18, 2019 Athena 将忽略具有 GLACIER 存储的对象 class 而不是使查询失败:

[…] As a result of fixing this issue, Athena ignores objects transitioned to the GLACIER storage class. Athena does not support querying data from the GLACIER storage class.

您必须有一个 S3 存储桶才能使用。此外,您用于启动 S3 Glacier Select 作业的 AWS 账户必须具有 S3 存储桶的写入权限。 Amazon S3 存储桶必须与包含正在查询的存档对象的保管库位于同一 AWS 区域。

S3 glacier select 运行查询并存储在 S3 存储桶中

最重要的是,您必须将数据移动到 S3 buck 中才能使用 S3 glacier select 语句。然后在 'new' S3 存储桶上使用 Athena。