Use the zonegroup create command to create a zone group. A default
zone group must always exist.
About this task
Make one zone group in the list of zone groups be the default zone group. If there is only
one zone group and it wasn’t specified as the default zone group when it was created, make it the
default zone group.Note: Only one default realm can exist at a time.
Creating a zone group
consists of specifying the zone group name. Creating a zone assumes that it is created in the
default realm unless --rgw-realm=REALM_NAME is
specified.
Specify whether the zone group is the primary zone group, by using the
--master flag.
Important: Do not use the zone group with the
--default flag
if the data and metadata are stored in the
default.rgw.data and
default.rgw.index pools. If a new zone group is set as the default and these pools
contain important data, the
radosgw-admin utility can fail to manage this data
properly.
Only use the --default flag if necessary to specify the zone group
as the default and if you do not need the existing data or metadata in the
default.rgw pools. If the existing data or metadata is needed, either migrate the
default configuration to a multi-site or zone group setup or avoid setting the new zone group as the
default. For more information about migrating to a multi-site, see Migrating a single site system to multi-site. By specifying
--default, the zone group is called implicitly with each
radosgw-admin call unless --rgw-zonegroup and the zone group name
are explicitly provided.
Procedure
- Create a zone group.
radosgw-admin zonegroup create --rgw-zonegroup=ZONE_GROUP_NAME [--rgw-realm=REALM_NAME] [--master]
For
example,
[ceph: root@host01 /]# radosgw-admin zonegroup create --rgw-zonegroup=zonegroup1 --rgw-realm=test_realm --default
In
this example,
zonegroup1 becomes the default zone group.
Note: When the zone group
is default, the command line assumes
--rgw-zonegroup=ZONE_GROUP_NAME as an
argument.
- Optional: Change a zone group setting.
radosgw-admin zonegroup modify --rgw-zonegroup=ZONE_GROUP_NAME
For
example,
[ceph: root@host01 /]# radosgw-admin zonegroup modify --rgw-zonegroup=zonegroup1
- Optional: Change the default zone group.
radosgw-admin zonegroup default --rgw-zonegroup=ZONE_GROUP_NAME
For
example,
[ceph: root@host01 /]# radosgw-admin zonegroup default --rgw-zonegroup=zonegroup2
- Commit the change.
radosgw-admin period update --commit
For
example,
[ceph: root@host01 /]# radosgw-admin period update --commit