Amazon S3 Glacier 到 GCS¶
Amazon Glacier 是一种安全、持久且成本极低的 Amazon S3 云存储类别,用于数据归档和长期备份。
先决任务¶
要使用这些操作器,您必须做几件事
使用 AWS Console 或 AWS CLI 创建必要的资源。
通过 pip 安装 API 库。
pip install 'apache-airflow[amazon]'详细信息可在 Airflow® 安装 找到
设置连接.
操作器¶
Amazon S3 Glacier 到 GCS 传输操作器¶
要将数据从 Amazon Glacier 保险库传输到 Google Cloud Storage,可以使用 GlacierToGCSOperator
tests/system/amazon/aws/example_glacier_to_gcs.py
transfer_archive_to_gcs = GlacierToGCSOperator(
task_id="transfer_archive_to_gcs",
vault_name=vault_name,
bucket_name=gcs_bucket_name,
object_name=gcs_object_name,
gzip=False,
# Override to match your needs
# If chunk size is bigger than actual file size
# then whole file will be downloaded
chunk_size=1024,
)
注意
请注意,GlacierToGCSOperator 依赖于可用内存。传输大文件可能会耗尽 worker 主机上的内存。