阿里云oss迁移到AWS S3

编程入门 行业动态 更新时间:2024-10-25 16:25:34

<a href=https://www.elefans.com/category/jswz/34/1770131.html style=阿里云oss迁移到AWS S3"/>

阿里云oss迁移到AWS S3

这里写自定义目录标题

    • 0.项目背景
    • 1.rclone 方式
    • 2.rsync方式
    • 3.注意

0.项目背景

公司迁移要求:从阿里云oss到亚马逊s3,数据量大概500G-2T左右。
开启阿里云oss 加速模式,这样能够跨机房和区域加速。
主要采用以下两种方式同步数据,根据每个公司情况自行选择即可。

1.rclone 方式

#s3 挂载
s3fs ad-amazon-ad /ad-amazon-ad -o url=,endpoint=us-east-1,allow_other,uid=1000,gid=1000,mp_umask=007,use_cache=/tmp

s3fs yinta-website /yinta-website -o url=,endpoint=us-east-1,allow_other,uid=1000,gid=1000,mp_umask=007,use_cache=/tmp

s3fs erp-info-test /erp-info-test -o url=,endpoint=ap-east-1,allow_other,uid=1000,gid=1000,mp_umask=007,use_cache=/tmp

s3fs erp-info /erp-info -o url=,endpoint=ap-east-1,allow_other,uid=1000,gid=1000,mp_umask=007,use_cache=/tmp

s3fs erp-usinfo /erp-usinfo -o url=,endpoint=us-east-1,allow_other,uid=1000,gid=1000,mp_umask=007,use_cache=/tmp

#rclone 配置信息
[aws-s3]
type = s3
provider = AWS
access_key_id = xxxxx
secret_access_key = xxxxx
region = ap-east-1
endpoint = s3.ap-east-1.amazonaws
location_constraint = ap-east-1

[ali-oss]
type = s3
provider = Alibaba
access_key_id = xxxx
secret_access_key = xxxxx
endpoint = oss-accelerate.aliyuncs

#传输命令

nohup rclone sync -P --transfers 8 --checkers 8 --s3-chunk-size 8M --s3-upload-concurrency 8 --log-file=/tmp/rclone.txt --log-level INFO ali-oss:ad-amazon-ad aws-s3-us:ad-amazon-ad>/tmp/ad-amazon-ad.log &

nohup rclone sync -P --transfers 8 --checkers 8 --s3-chunk-size 8M --s3-upload-concurrency 8 --log-file=/tmp/rclone.txt --log-level INFO ali-oss:yinta-website aws-s3-us:yinta-website>/tmp/yinta-website.log &

nohup rclone sync -P --transfers 8 --checkers 8 --s3-chunk-size 8M --s3-upload-concurrency 8 --log-file=/tmp/rclone.txt --log-level INFO ali-oss:erp-info-test aws-s3:erp-info-test >/tmp/rc-test.log &

nohup rclone sync -P --transfers 32 --checkers 16 --s3-chunk-size 15M --s3-upload-concurrency 16 --log-file=/tmp/rclone.txt --log-level INFO ali-oss:erp-usinfo aws-s3-us:erp-usinfo>/tmp/rc-us.log &

nohup rclone sync -P --transfers 32 --checkers 16 --s3-chunk-size 15M --s3-upload-concurrency 16 --log-file=/tmp/rclone.txt --log-level INFO ali-oss:erp-info aws-s3:erp-info >/tmp/rc.log &

#统计s3桶大小
aws s3 ls --summarize --human-readable --recursive s3://erp-info

s3cmd du s3://erp-info / --human-readable

erp-info-test-us 美国西部(俄勒冈) us-west-2 公开 换成弗吉尼亚地区。

参考:/

2.rsync方式

#1.挂载oss所需工具: ossfs
echo erp-info:akxxx:skxxxx > /etc/passwd-ossfs
chmod 600 /etc/passwd-ossfs

#挂载oss
ossfs erp-info /erp-info -ourl=oss-cn-hongkong-internal.aliyuncs

#2.挂载S3:所需工具s3fs
echo xxxxxx:xxxxxx/ > ~/.passwd-s3fs
chmod 600 ~/.passwd-s3fs

#挂载
s3fs erp-info-test /erp-info-test -o url=,endpoint=ap-east-1,allow_other,uid=1000,gid=1000,mp_umask=007,use_cache=/tmp

s3fs bi-zyb /bi-zyb -o url=,endpoint=ap-east-1,allow_other,uid=1000,gid=1000,mp_umask=007,use_cache=/tmp

s3fs yinta-website /yinta-website -o url=,endpoint=us-east-1,allow_other,uid=1000,gid=1000,mp_umask=007,use_cache=/tmp

s3fs ad-amazon-ad /ad-amazon-ad -o url=,endpoint=us-east-1,allow_other,uid=1000,gid=1000,mp_umask=007,use_cache=/tmp

#sync
[root@docker-yinta ~]# nohup rsync -av /erp-info-test/ root@16.163.255.57:/erp-info-test/ >/dev/null 2>&1 &
[1] 21449
[root@docker-yinta ~]# nohup rsync -av /erp-usinfo/ root@16.163.255.57:/erp-usinfo/ >/dev/null 2>&1 &
[2] 21562
[root@docker-yinta ~]# nohup rsync -av /erp-info/ root@16.163.255.57:/erp-info/ >/dev/null 2>&1 &
[3] 21759

3.注意

oss中带/ 的目录,用rsync ,rclone ,oss等都无法同步其中文件!!

更多推荐

阿里云oss迁移到AWS S3

本文发布于:2023-11-16 04:18:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1612598.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:阿里   oss   AWS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!