直接从S3复制到Google云端存储

lea*_*one 7 google-cloud-storage

我可以使用AWS SDK for Java和Azure SDk for Java将数据从Amazon AWS S3迁移到Azure.现在,我想使用Java将数据从Amazon AWS S3迁移到Google Cloud存储.

jte*_*ace 26

所述的gsutil命令行工具支持S3.运行configure命令后,您将在〜/ .boto文件中看到:

# To add aws credentials ("s3://" URIs), edit and uncomment the
# following two lines:
#aws_access_key_id = 
#aws_secret_access_key = 
Run Code Online (Sandbox Code Playgroud)

使用S3凭据填写aws_access_key_idaws_secret_access_key设置并取消注释变量.

设置完成后,从S3复制到GCS就像下面这样简单:

gsutil cp -R s3://bucketname gs://bucketname
Run Code Online (Sandbox Code Playgroud)

如果您有很多对象,请使用该-m标志与多个线程并行执行复制:

gsutil -m cp -R s3://bucketname gs://bucketname
Run Code Online (Sandbox Code Playgroud)


Jus*_*elt 9

使用Google云端存储转移工具.

Google云端存储转移工具


Anu*_*rag 5

jterrace(.boto 文件中的 aws 密钥和密钥)建议的答案是正确的,并且对我来说适用于许多区域,但不适用于某些仅需要 AWS 签名版本 4 的区域。例如,在连接到“孟买”区域时,我收到此错误:

BadRequestException: 400 InvalidRequest 不支持您提供的授权机制。请使用AWS4-HMAC-SHA256

为了克服这个问题(让 gsutil 使用 AWS Signature v4),我必须向 ~/.boto 文件添加以下附加行。这些行在配置文件中创建一个新部分 [s3]:

[s3]
主机 = s3.ap-south-1.amazonaws.com
use-sigv4 = True

参考:
AWS Signature Version 4 的互操作性支持
由于身份验证,Gsutil 无法复制到 s3