CEPH快速搭建八(Amazon S3 RESTful API访问ceph对象存储)

创建radosgw用户
[ceph@ceph-admin ~]$ radosgw-admin user create --uid=radosgw --display-name="radosgw"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{
"user_id": "radosgw",
"display_name": "radosgw",
"email": "",
"suspended": 0,
"max_buckets": 1000,
"auid": 0,
"subusers": [],
"keys": [
{
"user": "radosgw",
"access_key": "Y326T07XWSCYAG6LCZ2P",
"secret_key": "toCHP1BlY5Dta5nWqySEBtQGjtZwOmUJM9DOMSsE"
}
],
"swift_keys": [],
"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": []
}

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

安装s3cmd客户端(在node3上执行)
[root@ceph-node3 ~]# yum install -y s3cmd
[root@ceph-node3 ~]# s3cmd --configure
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[root@ceph-node3 ~]# 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: Y326T07XWSCYAG6LCZ2P
Secret Key: toCHP1BlY5Dta5nWqySEBtQGjtZwOmUJM9DOMSsE
Default Region [US]: ZH

Use "s3.amazonaws.com" for S3 Endpoint and not modify it to the target Amazon S3.
S3 Endpoint [s3.amazonaws.com]: 10.34.44.93:8899

Use "%(bucket)s.s3.amazonaws.com" to the target Amazon S3. "%(bucket)s" and "%(location)s" vars can be used
if the target S3 system supports dns based buckets.
DNS-style bucket+hostname:port template for accessing a bucket [%(bucket)s.s3.amazonaws.com]: 10.34.44.93:8899/%(bucket)

Encryption password is used to protect your files from reading
by unauthorized persons while in transfer to S3
Encryption password:
Path to GPG program [/usr/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: Y326T07XWSCYAG6LCZ2P
Secret Key: toCHP1BlY5Dta5nWqySEBtQGjtZwOmUJM9DOMSsE
Default Region: ZH
S3 Endpoint: s3.amazonaws.com
DNS-style bucket+hostname:port template for accessing a bucket: %(bucket)s.s3.amazonaws.com
Encryption password:
Path to GPG program: /usr/bin/gpg
Use HTTPS protocol: False
HTTP Proxy server name:
HTTP Proxy server port: 0

Test access with supplied credentials? [Y/n] n

Save settings? [y/N] y
Configuration saved to '/root/.s3cfg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

本地生成了一个.s3cfg的配置文件
[root@ceph-node3 ~]# ll .s3cfg
-rw-------. 1 root root 2086 Apr 12 01:28 .s3cfg
[root@ceph-node3 ~]# cat .s3cfg

创建桶并放入文件
[root@ceph-node3 ~]# s3cmd ls s3://first-bucket
[root@ceph-node3 ~]# s3cmd ls
2019-04-12 05:43 s3://first-bucket
[root@ceph-node3 ~]# s3cmd put /etc/hosts s3://first-bucket
upload: '/etc/hosts' -> 's3://first-bucket/hosts' [1 of 1]
250 of 250 100% in 2s 92.44 B/s done
[root@ceph-node3 ~]# s3cmd ls s3://first-bucket
2019-04-12 05:45 250 s3://first-bucket/hosts

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

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

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

https://blog.csdn.net/xx496146653/article/details/89248628

你可能感兴趣的:(ceph)