Skip to content

Instantly share code, notes, and snippets.

@rkachach
Last active September 15, 2022 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rkachach/83900882aed725199f6d860c96bdd9e6 to your computer and use it in GitHub Desktop.
Save rkachach/83900882aed725199f6d860c96bdd9e6 to your computer and use it in GitHub Desktop.
Credits: https://medium.com/@avmor/how-to-configure-rgw-multisite-in-ceph-65e89a075c1f
========= Download Ceph-nano ============
curl -L https://github.com/ceph/cn/releases/download/v2.3.1/cn-v2.3.1-linux-amd64 -o cn && chmod +x cn
========= On the primary cluster ============
# remember to change the variable 192.168.1.211 by the IP of your primary cluster
cn cluster start -d /tmp primary-cluster
cn cluster enter primary-cluster
radosgw-admin realm create --rgw-realm=gold
radosgw-admin zonegroup create --rgw-realm=gold --rgw-zonegroup=us --master --endpoints=http://192.168.1.211:8000
radosgw-admin zone create --rgw-realm=gold --rgw-zone=us-east --master --rgw-zonegroup=us --endpoints=http://192.168.1.211:8000 --access-key=1234567 --secret=098765
sed -i '${/^$/d;}' /etc/ceph/ceph.conf; echo "rgw_zone=us-east" >> /etc/ceph/ceph.conf
radosgw-admin period update --rgw-realm=gold --rgw-zonegroup=us --rgw-zone=us-east --commit
radosgw-admin user create --uid=repuser --display-name="Replication_user" --access-key=1234567 --secret=098765 --system
radosgw-admin period update --rgw-realm=gold --rgw-zonegroup=us --rgw-zone=us-east --commit
exit
cn cluster restart primary-cluster
========= On the secondary cluster ============
# remember to change the variable <secondary-ip> by the IP of your secondary cluster
cn cluster start -d /tmp secondary-cluster
cn cluster enter secondary-cluster
radosgw-admin realm pull --rgw-realm=gold --url=http://192.168.1.211:8000 --access-key=1234567 --secret=098765
radosgw-admin zone create --rgw-realm=gold --rgw-zone=us-west --rgw-zonegroup=us --endpoints=http://192.168.1.211:8001 --access-key=1234567 --secret=098765
sed -i '${/^$/d;}' /etc/ceph/ceph.conf; echo "rgw_zone=us-west" >> /etc/ceph/ceph.conf
radosgw-admin period update --rgw-realm=gold --rgw-zonegroup=us --rgw-zone=us-west --commit
radosgw-admin sync status
exit
cn cluster restart secondary-cluster
======== Some useful commands =======
cn cluster enter primary-cluster
radosgw-admin sync status
radosgw-admin realm list
radosgw-admin period list
radosgw-admin zone list
radosgw-admin zonegroup list
radosgw-admin user list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment