CEPH快速搭建九(swift API访问ceph对象存储)

创建swift api子用户
[ceph@ceph-admin ~]$ radosgw-admin subuser create --uid=radosgw --subuser=radosgw:swift --access=full
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{
"user_id": "radosgw",
"display_name": "radosgw",
"email": "",
"suspended": 0,
"max_buckets": 1000,
"auid": 0,
"subusers": [
{
"id": "radosgw:swift",
"permissions": "full-control"
}
],
"keys": [
{
"user": "radosgw",
"access_key": "Y326T07XWSCYAG6LCZ2P",
"secret_key": "toCHP1BlY5Dta5nWqySEBtQGjtZwOmUJM9DOMSsE"
}
],
"swift_keys": [
{
"user": "radosgw:swift",
"secret_key": "eCuvJmL2NbkgCAhGREDvYrtfDXRs064IbjIdwCtk"
}
],
"caps": [],
"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": []
}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


安装swift api客户端(在node3上执行)
[root@ceph-node3 ~]# yum install python-pip -y
[root@ceph-node3 ~]# pip install --upgrade python-swiftclient

查看
[root@ceph-node3 ~]# swift -A http://10.34.44.93:8899/auth/1.0 -U radosgw:swift -K eCuvJmL2NbkgCAhGREDvYrtfDXRs064IbjIdwCtk list
first-bucket
新增
[root@ceph-node3 ~]# swift -A http://10.34.44.93:8899/auth/1.0 -U radosgw:swift -K eCuvJmL2NbkgCAhGREDvYrtfDXRs064IbjIdwCtk post second-bucket


[root@ceph-node3 ~]# s3cmd ls
2019-04-12 05:43 s3://first-bucket
2019-04-12 08:23 s3://second-bucket

 

书写文档不易,如果你觉得我写得可以打个赏呗

https://www.fageka.com/store/item/s/id/Yx6TZ1m0747.html

你可能感兴趣的:(ceph)