我想移动约1个百万个文件从Azure存储到S3。我使用Azure python sdk和boto3编写了这个python脚本。有效地从Azure的Blob存储的数据复制到S3
marker = None
while True:
batch = azure_blob_service.list_blobs(
container, marker=marker)
# copy blobs in batches
for blob in batch:
blob_name = blob.name
current_blob = azure_blob_service.get_blob_to_bytes(
copy_from_container, blob_name)
s3_client.put_object(
Body=current_blob.content,
Bucket=s3_bucket,
ContentType=current_blob.properties.content_settings.content_type,
Key=blob_name)
if not batch.next_marker:
break
marker = batch.next_marker
但是这很慢。
我怎样才能有效地从蔚蓝的数据移动到S3?
它已经很长了我与S3工作,所以我可能是错的,但S3不支持服务器端复制。正确?只有您可用的选项是从Azure将Blob下载到本地磁盘,然后将其上传回S3。对? –
@GauravMantri是的,我没有找到类似的东西。我也在做类似于你的事情。但不是将它们下载到磁盘,而是使用'get_blob_to_bytes',然后将其上传到S3。 –
'get_blob_to_bytes' ....你仍然在下载数据。你没有做的是将这些数据保存到本地磁盘,所以从网络的角度来看,你没有获得任何东西。 –