• 使用s3cmd操作ceph rgw



    安装


    1.
    sudo apt-get install -y python-pip sudo pip install s3cmd

    2. sudo apt-get install s3cmd
     

    配置

     s3cmd --configure

    根据提示输入accessKey,securityKey 生成基本的配置文件。

    修改host_base/host_bucket:

    host_base = ip-113-107-161-207:7480
    host_bucket = ip-113-107-161-207:7480/%(bucket)

    或者 直接新增配置文件如下:

    vi $HOME/.s3cfg
    [default]
    access_key = *
    secret_key = *
    host_base = s3.yyclouds.com
    host_bucket = s3.yyclouds.com/%(bucket)
    use_https = False

    基本操作

    Commands:
    Make bucket
    s3cmd mb s3://BUCKET
    Remove bucket
    s3cmd rb s3://BUCKET
    List objects or buckets
    s3cmd ls [s3://BUCKET[/PREFIX]]
    List all object in all buckets
    s3cmd la
    Put file into bucket
    s3cmd put FILE [FILE...] s3://BUCKET[/PREFIX]
    Get file from bucket
    s3cmd get s3://BUCKET/OBJECT LOCAL_FILE
    Delete file from bucket
    s3cmd del s3://BUCKET/OBJECT
    Delete file from bucket (alias for del)
    s3cmd rm s3://BUCKET/OBJECT
    Restore file from Glacier storage
    s3cmd restore s3://BUCKET/OBJECT
    Synchronize a directory tree to S3 (checks files freshness using size and md5 checksum, unless overridden by options, see below)
    s3cmd sync LOCAL_DIR s3://BUCKET[/PREFIX] or s3://BUCKET[/PREFIX] LOCAL_DIR
    Disk usage by buckets
    s3cmd du [s3://BUCKET[/PREFIX]]
    Get various information about Buckets or Files
    s3cmd info s3://BUCKET[/OBJECT]
    Copy object
    s3cmd cp s3://BUCKET1/OBJECT1 s3://BUCKET2[/OBJECT2]
    Modify object metadata
    s3cmd modify s3://BUCKET1/OBJECT
    Move object
    s3cmd mv s3://BUCKET1/OBJECT1 s3://BUCKET2[/OBJECT2]
    Modify Access control list for Bucket or Files
    s3cmd setacl s3://BUCKET[/OBJECT]
    Modify Bucket Policy
    s3cmd setpolicy FILE s3://BUCKET
    Delete Bucket Policy
    s3cmd delpolicy s3://BUCKET
    Modify Bucket CORS
    s3cmd setcors FILE s3://BUCKET
    Delete Bucket CORS
    s3cmd delcors s3://BUCKET
    Modify Bucket Requester Pays policy
    s3cmd payer s3://BUCKET
    Show multipart uploads
    s3cmd multipart s3://BUCKET [Id]
    Abort a multipart upload
    s3cmd abortmp s3://BUCKET/OBJECT Id
    List parts of a multipart upload
    s3cmd listmp s3://BUCKET/OBJECT Id
    Enable/disable bucket access logging
    s3cmd accesslog s3://BUCKET
    Sign arbitrary string using the secret key
    s3cmd sign STRING-TO-SIGN
    Sign an S3 URL to provide limited public access with expiry
    s3cmd signurl s3://BUCKET/OBJECT <expiry_epoch|+expiry_offset>
    Fix invalid file names in a bucket
    s3cmd fixbucket s3://BUCKET[/PREFIX]
    Create Website from bucket
    s3cmd ws-create s3://BUCKET
    Delete Website
    s3cmd ws-delete s3://BUCKET
    Info about Website
    s3cmd ws-info s3://BUCKET
    Set or delete expiration rule for the bucket
    s3cmd expire s3://BUCKET
    Upload a lifecycle policy for the bucket
    s3cmd setlifecycle FILE s3://BUCKET
    Remove a lifecycle policy for the bucket
    s3cmd dellifecycle s3://BUCKET
    List CloudFront distribution points
    s3cmd cflist
    Display CloudFront distribution point parameters
    s3cmd cfinfo [cf://DIST_ID]
    Create CloudFront distribution point
    s3cmd cfcreate s3://BUCKET
    Delete CloudFront distribution point
    s3cmd cfdelete cf://DIST_ID
    Change CloudFront distribution point parameters
    s3cmd cfmodify cf://DIST_ID
    Display CloudFront invalidation request(s) status
    s3cmd cfinvalinfo cf://DIST_ID[/INVAL_ID]

    For more information, updates and news, visit the s3cmd website:
    http://s3tools.org

    参考

    s3cmd with radosgw

  • 相关阅读:
    网络摄像头Androi端显示(mjpeg)源码分析
    STM32F103 MQTT智能配网ESP07S WIFI 手机app控制继电器EMQ温湿度
    安装云服务器 ECS CentOS 7 图形化桌面
    PT100多路分布式LORA无线测温传感器工业设备老化温度监控记录仪
    把qt 程序打包成一个exe可以执行的文件
    STM32L051C8T6 HAL DMA IDLE串口不定长接收遇到的问题
    Project ERROR: Cannot run target compiler '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++'. Output:
    更换下平台
    H5单页面应用(SPA)架构总结
    财务系统功能开发要点概述
  • 原文地址:https://www.cnblogs.com/bodhitree/p/6114489.html
Copyright © 2020-2023  润新知