bucket. If omitted the utility will try to determine the data pool
on its own.
+.. option:: -r <realm-name>
+
+ Optional, specify the realm if the restoration is not being applied
+ to the default realm.
+
+.. option:: -g <zonegroup-name>
+
+ Optional, specify the zonegroup if the restoration is not being applied
+ to the default zonegroup.
+
+.. option:: -z <zone-name>
+
+ Optional, specify the zone if the restoration is not being applied
+ to the default zone.
+
.. option:: -l <rados-ls-output-file>
Optional, specify a file containing the output of a rados listing
Usage: $0 -b <bucketname> [-l <rados-ls-file>] [-p <pool>] [-y]
where:
- -b <bucketname> Required - name of the bucket to operate on
- -l <rados-ls-file> Optional - file containing the output of 'rados ls -p <pool>'
- -p <pool> Optional - data pool; if not provided will be inferred from bucket and zone information
- -y Optional - proceed with restoring without confirming with the user
- USE WITH CAUTION.
- -d Optional - run with debugging output
+ -b <bucketname> Required - name of the bucket to operate on
+ -l <rados-ls-file> Optional - file containing the output of 'rados ls -p <pool>'
+ -r <realm-name> Optional - specify the realm if not applying to the default realm"
+ -g <zonegroup-name> Optional - specify the zonegroup if not applying to the default zonegroup"
+ -z <zone-name> Optional - specify the zone if not applying to the default zone"
+ -p <pool> Optional - data pool; if not provided will be inferred from bucket and zone information
+ -y Optional - proceed with restoring without confirming with the user
+ USE WITH CAUTION.
+ -d Optional - run with debugging output
EOF
super_exit
}
plmt_class=STANDARD
fi
- radosgw-admin zone get >$zone_info 2>/dev/null
+ radosgw-admin zone get $multisite_spec >$zone_info 2>/dev/null
pool=$(jq -r ".placement_pools [] | select(.key | contains(\"${plmt_pool}\")) .val .storage_classes.${plmt_class}.data_pool" $zone_info)
if [ -z "$pool" ] ;then
export bucket=""
pool=""
+multisite_spec=""
lsoutput=""
debug=0
-while getopts "b:l:p:yd" o; do
+while getopts "b:l:p:r:g:z:yd" o; do
case "${o}" in
b)
bucket="${OPTARG}"
p)
pool="${OPTARG}"
;;
+ r)
+ multisite_spec="$multisite_spec --rgw-realm=${OPTARG}"
+ ;;
+ g)
+ multisite_spec="$multisite_spec --rgw-zonegroup=${OPTARG}"
+ ;;
+ z)
+ multisite_spec="$multisite_spec --rgw-zone=${OPTARG}"
+ ;;
y)
echo "NOTICE: This tool is currently considered EXPERIMENTAL."
proceed=1
fi
# read bucket entry metadata
-eval "radosgw-admin metadata get bucket:$bucket $debugging_rgwadmin >$bkt_entry"
+eval "radosgw-admin metadata get bucket:$bucket $debugging_rgwadmin $multisite_spec >$bkt_entry"
export marker=$(jq -r ".data.bucket.marker" $bkt_entry)
export bucket_id=$(jq -r ".data.bucket.bucket_id" $bkt_entry)
if [ -z "$marker" -o -z "$bucket_id" ] ;then
echo bucket_id is $bucket_id
# read bucket instance metadata
-eval "radosgw-admin metadata get bucket.instance:${bucket}:$bucket_id $debugging_rgwadmin >$bkt_inst"
+eval "radosgw-admin metadata get bucket.instance:${bucket}:$bucket_id $multisite_spec $debugging_rgwadmin >$bkt_inst"
# examine number of bucket index shards
num_shards=$(jq ".data.bucket_info.num_shards" $bkt_inst)
done
fi
-eval "radosgw-admin object reindex --bucket=$bucket --objects-file=$obj_list_ver --yes-i-really-mean-it $debugging_rgwadmin"
+eval "radosgw-admin object reindex --bucket=$bucket --objects-file=$obj_list_ver $multisite_spec --yes-i-really-mean-it $debugging_rgwadmin"
clean
echo Done