Skip to content

Instantly share code, notes, and snippets.

@kalaspuffar
Last active August 20, 2024 06:18
Show Gist options
  • Save kalaspuffar/94b338168fe7200cb44b8111cb3172b3 to your computer and use it in GitHub Desktop.
Save kalaspuffar/94b338168fe7200cb44b8111cb3172b3 to your computer and use it in GitHub Desktop.
Simple installation of a Ceph RADOS gateway
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
@kalaspuffar
Copy link
Author

Hi @icepic

It all has to do with the size of the cluster, a large enough cluster should not have this problem but I guess for a single node cluster there might be some tweeks you need for all kind of services for example.

Best regards
Daniel

@plumbery
Copy link

Hello @icepic thanks for the video and repo. It's very helpfull.
i have a trouble in setting up credentials step. I run this command but i got error. Error is,
root@pm01:/etc/ceph# ceph dashboard set-rgw-credentials Error EINVAL: No RGW credentials found, please consult the documentation on how to enable RGW for the dashboard.

I think this command searching some keyring file in some directory. I checked my /etc/ceph directory and there is no client.admin keyring in that directory and i don't know why and how to create it.

I tried to import credentials manually with bellow commands.
ceph dashboard set-rgw-api-secret-key -i ./secretkey.txt ceph dashboard set-rgw-api-access-key -i ./accesskey.txt i used synchronization-user secret and key in here

after import api secret and key i become to able to see object gatewat in dashboard but i am not able to list any object, it's like still i have credentials problem i cant fetch any object from rgw.

What do you think how can i resolve this issue ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment