在 GCE 中将文件从区域存储桶移动到多区域存储桶

Move files from Regional to Multiregional Bucket in GCE

我在 Google 计算机引擎中有一个 "nearline" + "europe-west4 (Netherlands)" 桶。如果存储桶中的文件达到一定年龄(比如 6 个月),我想将它们移动到 "coldline" + "mutli-regional (EU)" 存储桶。我尝试使用存储桶生命周期规则实现此行为,但不幸的是文档说,您不能将文件从 "regional" 移动到 "multiregional" 存储桶。

我该如何实现这种行为?除了存储桶生命周期规则之外,还有其他方法可以做到这一点吗?

是的,根据文档 Lifecycle actions:

For buckets in a region, the new storage class cannot be Multi-Regional Storage.

因此,如果您想使用生命周期来管理数据的存储 Class,您应该切换到使用相同位置 区域或多区域。您可以在文档 Bucket locations:

中找到更多信息

Use a region to help optimize latency and network bandwidth for data consumers, such as analytics pipelines, that are grouped in the same region.

Use a multi-region when you want to serve content to data consumers that are outside of the Google network and distributed across large geographic areas, or when you want the higher availability that comes with being geo-redundant.

作为可能的解决方法,您可以尝试 Storage Transfer Service:

Storage Transfer Service allows you to quickly import online data into Cloud Storage. You can also set up a repeating schedule for transferring data, as well as transfer data within Cloud Storage, from one bucket to another.

您可以使用像 Filter transferred files by last-modified timeMin age[= 这样的过滤器来安排您的区域和多区域存储桶之间的每日传输37=] 和 Max age 小时,以及 Delete objects from source once they are transferred.

等选项