RGW multisite: realm, zonegroups, zones and the period
In the book: Chapter 5, Chapter 42, K Multisite and DR
RGW multisite: realm, zonegroups, zones and the period
Lay out the realm, zonegroups and zones, pick the master zone, set the sync direction with sync-from or a sync policy, and see with period update --commit how the period moves on; also see the radosgw-admin commands for each step and the replication lag after a link outage.
These changes are not committed yet: the zones run the current period (epoch 2), and the arrows in the figure show that one too.
Staged changes and their commands
In the cluster of zone eu-3:
radosgw-admin realm pull --url=http://rgw-eu-1.example.com:80 --access-key=<AK> --secret=<SK>
radosgw-admin realm default --rgw-realm=gold
radosgw-admin period pull --url=http://rgw-eu-1.example.com:80 --access-key=<AK> --secret=<SK>
radosgw-admin zone create --rgw-zonegroup=europe --rgw-zone=eu-3 --endpoints=http://rgw-eu-3.example.com:80 --access-key=<AK> --secret=<SK>In the cluster of zone eu-1:
radosgw-admin zone modify --rgw-zone=eu-1 --sync-from-all=false
radosgw-admin zone modify --rgw-zone=eu-2 --sync-from-all=false --sync-from=eu-1
radosgw-admin zone modify --rgw-zone=eu-3 --sync-from-all=false --sync-from=eu-1radosgw-admin period update --commit # on eu-1Replication lag eu-1 → eu-2
If the source zone is lost at the end of the outage, about 90000 objects (about 90 GB) existed only there; multisite sync is asynchronous and its RPO is this backlog.
backlog = writes/s × outage · catch-up = backlog / (μ − writes/s)
radosgw-admin sync status
radosgw-admin period get
radosgw-admin data sync status --source-zone=eu-1
radosgw-admin sync error listThe whole setup of this layout, cluster by cluster (chapter 5)
In the cluster of zone eu-1:
radosgw-admin realm create --rgw-realm=gold --default
radosgw-admin zonegroup create --rgw-zonegroup=europe --endpoints=http://rgw-eu-1.example.com:80 --rgw-realm=gold --master --default
radosgw-admin zone create --rgw-zonegroup=europe --rgw-zone=eu-1 --endpoints=http://rgw-eu-1.example.com:80 --master --default
radosgw-admin user create --uid=sync-user --display-name="Multisite sync" --system
radosgw-admin zone modify --rgw-zone=eu-1 --access-key=<AK> --secret=<SK>
radosgw-admin period update --commitIn the cluster of zone eu-2:
radosgw-admin realm pull --url=http://rgw-eu-1.example.com:80 --access-key=<AK> --secret=<SK>
radosgw-admin realm default --rgw-realm=gold
radosgw-admin period pull --url=http://rgw-eu-1.example.com:80 --access-key=<AK> --secret=<SK>
radosgw-admin zone create --rgw-zonegroup=europe --rgw-zone=eu-2 --endpoints=http://rgw-eu-2.example.com:80 --access-key=<AK> --secret=<SK>
radosgw-admin period update --commitIn the cluster of zone eu-3:
radosgw-admin realm pull --url=http://rgw-eu-1.example.com:80 --access-key=<AK> --secret=<SK>
radosgw-admin realm default --rgw-realm=gold
radosgw-admin period pull --url=http://rgw-eu-1.example.com:80 --access-key=<AK> --secret=<SK>
radosgw-admin zone create --rgw-zonegroup=europe --rgw-zone=eu-3 --endpoints=http://rgw-eu-3.example.com:80 --access-key=<AK> --secret=<SK>
radosgw-admin period update --commitIn the cluster of zone eu-1:
radosgw-admin zone modify --rgw-zone=eu-1 --sync-from-all=false
radosgw-admin zone modify --rgw-zone=eu-2 --sync-from-all=false --sync-from=eu-1
radosgw-admin zone modify --rgw-zone=eu-3 --sync-from-all=false --sync-from=eu-1
radosgw-admin period update --commitceph orch apply rgw gold-eu-1 --realm=gold --zone=eu-1 --placement="label:rgw count-per-host:1" --port=80
ceph orch apply rgw gold-eu-2 --realm=gold --zone=eu-2 --placement="label:rgw count-per-host:1" --port=80
ceph orch apply rgw gold-eu-3 --realm=gold --zone=eu-3 --placement="label:rgw count-per-host:1" --port=80Put the master zone where most metadata writes (bucket and user creation) come from, and check every zone's sync status before you move it. A sync policy sets the direction without touching each zone's sync-from list and also works per bucket; both ways take effect after period update --commit.
Follows:
src/rgw/rgw_zone.cc :: fork_period, commit_period (FIRST_EPOCH, the master-zone check, epoch + 1)Commit on the master zone, a higher epoch or a new periodsrc/rgw/radosgw-admin/radosgw-admin.cc :: zone modify --sync-from-all / --sync-from, sync group flow / pipeEach zone's sync-from list, and the group, flow and pipe of a sync policysrc/common/options/rgw.yaml.in :: rgw_data_sync_poll_interval, rgw_data_sync_spawn_window, rgw_data_log_num_shards, rgw_data_notify_interval_msecThe sync defaults the lag model usesdoc/radosgw/multisite.rst, doc/radosgw/multisite-sync-policy.rstThe multisite and sync policy documentation