对象存储运维操作(一)
1、realm、zongroup、zone及桶之间的关系
一个realm代表了全局唯一的命名空间,由一个或者多个zonegroup组成,zonegroup可以包含一个或多个zone,zone包含了桶,桶里包依次存放了对象。
1 CREATE A REALM(领域) 2 M: # radosgw-admin realm create --rgw-realm={realm-name} [--default] 3 E: # radosgw-admin realm create --rgw-realm=zzc-realm --default 4 5 CREATE A MASTER ZONE GROUP 6 M: # radosgw-admin zonegroup create --rgw-zonegroup={name} --endpoints={url} [--rgw-realm={realm-name}|--realm-id={realm-id}] --master --default 7 E: # radosgw-admin zonegroup create --rgw-zonegroup=zzc-us --endpoints=http://10.2.1.151:80,http://10.2.1.152:80,http://10.2.1.153:80 --rgw-realm=zzc-realm --master --default 8 9 CREATE A MASTER ZONE 10 M: # radosgw-admin zone create --rgw-zonegroup={zone-group-name} \ 11 --rgw-zone={zone-name} \ 12 --master --default \ 13 --endpoints={http://fqdn}[,{http://fqdn}] 14 E: # radosgw-admin zone create --rgw-zonegroup=zzc-us --rgw-zone=zzc-us-idc --master --default --endpoints=ceph.int.s3.com
删除默认ZONE GROUP与ZONE
1 DELETE DEFAULT ZONE GROUP AND ZONE¶ 2 Delete the default zone if it exists. Make sure to remove it from the default zone group first. 3 # radosgw-admin zonegroup remove --rgw-zonegroup=default --rgw-zone=default 4 # radosgw-admin period update --commit 5 # radosgw-admin zone delete --rgw-zone=default 6 # radosgw-admin period update --commit 7 # radosgw-admin zonegroup delete --rgw-zonegroup=default 8 # radosgw-admin period update --commit 9 Finally, delete the default pools in your Ceph storage cluster if they exist. 10 11 Important The following step assumes a multi-site configuration using newly installed systems that aren’t currently storing data. DO NOT DELETE the default zone group if you are already using it to store data. 12 # ceph osd pool rm default.rgw.control default.rgw.control --yes-i-really-really-mean-it 13 # ceph osd pool rm default.rgw.data.root default.rgw.data.root --yes-i-really-really-mean-it 14 # ceph osd pool rm default.rgw.gc default.rgw.gc --yes-i-really-really-mean-it 15 # ceph osd pool rm default.rgw.log default.rgw.log --yes-i-really-really-mean-it 16 # ceph osd pool rm default.rgw.users.uid default.rgw.users.uid --yes-i-really-really-mean-it 17 18 19 CREATE A SYSTEM USER 20 M: # radosgw-admin user create --uid="{user-name}" --display-name="{Display Name}" --system 21 E: # radosgw-admin user create --uid="zzc" --display-name="cephrgw user" --system