官网:开始-简介
百度文库:AmazonS3架构分析
知乎:S3高可靠演进

S3核心思想:
从使用者角度,存储的形式/载体是以桶来管理。可以创建桶(Bucket),然后可以往桶里存储对象(文件),一个桶可以放很多对象。可以使用http的一组api对对象进行管理。
S3就像一个部署在全球网络的硬盘,如果地方比较固定,可以指定桶所在的区域region如华南来减少时延。
image.png
存储的实现由一系列组件完成:webservice为对外接口,coordinator负责协调请求,nodepicker负责选择副本存储位置,keymap负责索引,bitStore完成存储,replicator来复制副本,DFDD监控
image.png

桶和对象是对外部概念,具体对象存储在BitrStore Node。

S3会出故障吗?
会的,出现过还不止一次。有服务暂停几个小时的,但确凿的丢数据的报道没有。服务说明按时间,99%可用,具体看不同区域的说明。
AWS中断 对Amazon S3用户造成严重破坏
AWS 的 S3 故障回顾和思考
AWS S3 上有少量的数据丢失,不知道该怎么搞?

s3常用操作

创建profile

询问管理员要id,key等信息:

  1. ]# aws configure --profile webscale
  2. aws_access_key_id = xxxxid
  3. aws_secret_access_key = yyyykey
  4. Default region name [None]: us-gov-west-1
  5. Default output format [json]: json

测试

  1. >cat testS3.sh
  2. #!/bin/bash
  3. #input keys
  4. #echo "type accesskey:"
  5. #read accesskey
  6. #echo "type secret:"
  7. #read secret
  8. #echo accesskey=$accesskey,secret=$secret.
  9. url="http://192.168.52.40:8084"
  10. profile="webscale"
  11. #1.create bucket
  12. #list buckets
  13. #aws s3 ls --profile $profile --endpoint-url $url
  14. aws s3 ls --profile $profile --endpoint-url $url
  15. #create
  16. aws s3 mb s3://bucket-test --profile $profile --endpoint-url $url
  17. #list
  18. aws s3 ls s3://bucket-test --profile $profile --endpoint-url $url
  19. #2.push file
  20. aws s3 ls s3://bucket-test --profile $profile --endpoint-url $url
  21. aws s3 cp /etc/yum.conf s3://bucket-test/ --profile $profile --endpoint-url $url
  22. #3.ls files
  23. aws s3 ls s3://bucket-test --profile $profile --endpoint-url $url
  24. #4.delete file
  25. aws s3 rm s3://bucket-test/yum.conf --profile $profile --endpoint-url $url
  26. aws s3 ls s3://bucket-test --profile $profile --endpoint-url $url
  27. #5.delete bucket
  28. aws s3 rb s3://bucket-test --profile $profile --endpoint-url $url
  29. aws s3 ls --profile $profile --endpoint-url $url