Amazon offers Simple Storage Service (S3) to provide storage through web interfaces such as REST. Ceph extends its compatibility with S3 through RESTful API. S3 client applications can access the Ceph object storage based on access and secret keys. Let's now see how to configure this. Perform the following commands on the ceph-rgw node until otherwise specified:
mona
):# radosgw-admin caps add --uid=mona --caps="users=*" # radosgw-admin caps add --uid=mona --caps="buckets=*" # radosgw-admin caps add --uid=mona --caps="metadata=*" radosgw-admin caps add --uid=mona --caps="zone=*"
<object_name>.<RGW_Fqdn>
. For example, if you have a bucket named jupiter
, it will be accessible over HTTP via the URL http://jupiter.ceph-rgw.objectstore.com
.Perform the following steps to configure DNS on the ceph-rgw node. If you have an existing DNS server, you can use it with slight modifications.
# yum install bind* -y
/etc/named.conf
, the IP address, and the IP range and zone as mentioned in the following code. You can match the changes from the author's version of the named.conf
file provided with this book's code bundle:listen-on port 53 { 127.0.0.1;192.168.57.110; }; ### Add DNS IP ### allow-query { localhost;192.168.57.0/24; }; ### Add IP Range ### ### Add new zone for domain objectstore.com before EOF ### zone "objectstore.com" IN { type master; file "db.objectstore.com"; allow-update { none; }; };
/etc/named.conf
./var/named/db.objectstore.com
with the following content. You can match the changes from the author's version of the db.objectstore.com
file provided with this book:@ 86400 IN SOA objectstore.com. root.objectstore.com. ( 20091028 ; serial yyyy-mm-dd 10800 ; refresh every 15 min 3600 ; retry every hour 3600000 ; expire after 1 month + 86400 ); min ttl of 1 day @ 86400 IN NS objectstore.com. @ 86400 IN A 192.168.57.110 * 86400 IN CNAME @
# service iptables stop
/etc/resolve.conf
and add the following content:search objectstore.com nameserver 192.168.57.110
# service named start
# named-checkconf /etc/named.conf # named-checkzone objectstore.com /var/named/db.objectstore.com
# dig ceph-rgw.objectstore.com # nslookup ceph-rgw.objectstore.com
/etc/resolve.conf
on ceph-client1 and add the following content:search objectstore.com nameserver 192.168.57.110
# dig ceph-rgw.objectstore.com # nslookup ceph-rgw.objectstore.com
ceph-rgw.objectstore.com
.# yum install s3cmd
access _key
and secret_key
for a user; in our case, the user ID is mona
that we created in the first step:# s3cmd --configure
.s3cfg
file under /root
; edit this file for the RADOS gateway host details. Modify host_base
and host_bucket
, as shown in the following snippet. Make sure these lines do not have trailing spaces at the end:host_base = ceph-rgw.objectstore.com host_bucket = %(bucket)s.ceph-rgw.objectstore.com
You can match the changes from the author's version of the .s3cfg
file provided with this book.
# s3cmd ls # s3cmd mb s3://first-bucket # s3cmd put /etc/hosts s3://first-bucket
Ceph supports a RESTful API that is compatible with the basic data access model of the Swift API. To use Ceph object storage using the Swift API, we need to create a Swift subuser on the Ceph RADOS gateway, which will allow the Swift API to access Ceph object storage:
# radosgw-admin subuser create --uid=mona --subuser=mona:swift --access=full --secret=secretkey --key-type=swift
# yum install python-setuptools # easy_install pip # pip install --upgrade setuptools # pip install python-swiftclient
# swift -V 1.0 -A http://ceph-rgw.objectstore.com/auth -U mona:swift -K secretkey post example-bucket # swift -V 1.0 -A http://ceph-rgw.objectstore.com/auth -U mona:swift -K secretkey list
18.118.205.235