How to setup a RADOS Gateway for an S3 API in Ceph
We look into how to install the Ceph RADOS Gateway to enable the S3 API on our ceph cluster. Using a gateway in order to simplify the object handling is a usual practice but we will also look into how to setup a region / zone and what is required to sync your data centers.
sudo apt install radosgw
sudo mkdir -p /var/lib/ceph/radosgw/ceph-rgw.`hostname -s`
sudo ceph auth get-or-create client.rgw.`hostname -s` osd 'allow rwx' mon 'allow rw' -o /var/lib/ceph/radosgw/ceph-rgw.`hostname -s`/keyring
[client.rgw.n1]
host = n1
keyring = /var/lib/ceph/radosgw/ceph-rgw.n1/keyring
log file = /var/log/ceph/ceph-rgw-n1.log
rgw frontends = "beast endpoint=192.168.6.44:8080"
rgw thread pool size = 512
sudo systemctl start ceph-radosgw@rgw.`hostname -s`
sudo systemctl status ceph-radosgw@rgw.`hostname -s`
sudo systemctl enable ceph-radosgw@rgw.`hostname -s`
sudo radosgw-admin realm create --rgw-realm=eu-east --default
sudo radosgw-admin zonegroup create --rgw-zonegroup=eu --endpoints=http://n1:8080,http://n2:8080,http://n3:8080 --rgw-realm=eu-east --master --default
sudo radosgw-admin zone create --rgw-zonegroup=eu --endpoints=http://n1:8080,http://n2:8080,http://n3:8080 --rgw-zone=eu-east --master --default
sudo radosgw-admin zonegroup remove --rgw-zonegroup=default --rgw-zone=default
sudo radosgw-admin period update --commit
sudo radosgw-admin zone delete --rgw-zone=default
sudo radosgw-admin period update --commit
sudo radosgw-admin zonegroup delete --rgw-zonegroup=default
sudo radosgw-admin period update --commit
sudo ceph config get mon mon_max_pg_per_osd
sudo ceph config set mon mon_max_pg_per_osd 500
sudo ceph osd pool delete default.rgw.control default.rgw.control --yes-i-really-really-mean-it
sudo ceph osd pool delete default.rgw.log default.rgw.log --yes-i-really-really-mean-it
sudo ceph osd pool delete default.rgw.meta default.rgw.meta --yes-i-really-really-mean-it
sudo radosgw-admin user create --uid="synchronization-user" --display-name="Synchronization User" --system
sudo radosgw-admin zone modify --rgw-zone=eu-east --access-key=9NNB6GYTK5Z8GDUORORH --secret=r7NR3YwciVzdlrS4eNuHwAfkLQ0cMFjj4LEJuBbv
sudo radosgw-admin period update --commit
rgw_zone=eu-east
sudo systemctl restart ceph-radosgw@rgw.`hostname -s`
sudo ceph dashboard set-rgw-credentials
sudo systemctl stop ceph-radosgw@rgw.`hostname -s`
sudo systemctl disable ceph-radosgw@rgw.`hostname -s`
sudo rm -rf /var/lib/ceph/radosgw/ceph-rgw.`hostname -s`
sudo ceph osd pool delete eu-east.rgw.buckets.data eu-east.rgw.buckets.data --yes-i-really-really-mean-it
sudo ceph osd pool delete eu-east.rgw.buckets.index eu-east.rgw.buckets.index --yes-i-really-really-mean-it
sudo ceph osd pool delete eu-east.rgw.control eu-east.rgw.control --yes-i-really-really-mean-it
sudo ceph osd pool delete eu-east.rgw.log eu-east.rgw.log --yes-i-really-really-mean-it
sudo ceph osd pool delete eu-east.rgw.meta eu-east.rgw.meta --yes-i-really-really-mean-it
sudo ceph osd pool delete .rgw.root .rgw.root --yes-i-really-really-mean-it