Python 官方文档:入门教程 => 点击学习
安装s3cmdvirtualenv ven_s3 source ven_s3/bin/activate pip install pip --upgrade pip install s3cmd查看user keyradosgw-admin u
安装s3cmd
virtualenv ven_s3
source ven_s3/bin/activate
pip install pip --upgrade
pip install s3cmd
查看user key
radosgw-admin user info --uid=testuser
{
"user_id": "testuser",
"display_name": "First User",
"email": "",
"suspended": 0,
"max_buckets": 1000,
"auid": 0,
"subusers": [
{
"id": "testuser:swift",
"permissions": "full-control"
}
],
"keys": [
{
"user": "testuser",
"access_key": "UNQA07763EJDVFE1U82F",
"secret_key": "yERsPubsAxUjlIxsO9HOQ03EbEE2HrP88dikyObM"
}
],
"swift_keys": [
{
"user": "testuser:swift",
"secret_key": "joNclsgsrr2VJjezfTwlfZiuEz1b9OcUiTnRXBxp"
}
],
"caps": [
{
"type": "buckets",
"perm": "read"
},
{
"type": "metadata",
"perm": "*"
},
{
"type": "usage",
"perm": "*"
},
{
"type": "users",
"perm": "*"
}
],
"op_mask": "read, write, delete",
"default_placement": "",
"placement_tags": [],
"bucket_quota": {
"enabled": false,
"max_size_kb": -1,
"max_objects": -1
},
"user_quota": {
"enabled": false,
"max_size_kb": -1,
"max_objects": -1
},
"temp_url_keys": []
}
配置s3cmd
s3cmd --configure
Enter new values or accept defaults in brackets with Enter.
Refer to user manual for detailed description of all options.
Access key and Secret key are your identifiers for Amazon S3. Leave them empty for using the env variables.
Access Key: XA256MGT6DOJWG0WHUBM
Secret Key: CP7uaDpOK7rxHJmTjGrVfO5hd5oRUukzGSkBfL5E
Default Region [US]:
Encryption passWord is used to protect your files from reading
by unauthorized persons while in transfer to S3
Encryption password:
Path to GPG program [/bin/gpg]:
When using secure https protocol all communication with Amazon S3
servers is protected from 3rd party eavesdropping. This method is
slower than plain Http, and can only be proxied with python 2.7 or newer
Use HTTPS protocol [Yes]: no
On some networks all internet access must Go through a HTTP proxy.
Try setting it here if you can't connect to S3 directly
HTTP Proxy server name:
New settings:
Access Key: XA256MGT6DOJWG0WHUBM
Secret Key: CP7uaDpOK7rxHJmTjGrVfO5hd5oRUukzGSkBfL5E
Default Region: US
Encryption password:
Path to GPG program: /bin/gpg
Use HTTPS protocol: False
HTTP Proxy server name:
HTTP Proxy server port: 0
Test access with supplied credentials? [Y/n] y
Please wait, attempting to list all buckets...
ERROR: Test failed: [Errno -2] Name or service not known
Retry configuration? [Y/n] n
Save settings? [y/N] y
Configuration saved to '/home/b/.s3cfg'
由于是自建的radosgw,还需要配置如下三项:
cloudfont_host
host_base
host_bucket
其对应的配置如下:
cat .s3cfg
...
cloudfront_host = 192.168.1.200:8080
...
host_base = 192.168.1.200:8080
host_bucket = 192.168.1.200:8080/%(bucket)
s3cmd操作
s3cmd ls # 查看bucket
s3cmd mb s3://test # 创建bucket
s3cmd put .s3cfg s3://test # 上传文件
s3cmd la # 查看object
s3cmd get s3://test/.s3cfg # 下载文件
s3cmd rm s3://test/.s3cfg # 删除文件
s3cmd rb s3://test # 删除bucket
参考链接
http://www.lai18.com/content/6968965.html
--结束END--
本文标题: radowsgw 配置 s3cmd
本文链接: https://www.lsjlt.com/news/189816.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0