Skip to content

Ceph - Object Storage (Rados GW)

Commands

User/Bucket

List all users:

radosgw-admin metadata user list

List all buckets:

radosgw-admin metadata bucket list

Detail of a bucket:

radosgw-admin metadata get bucket:{bucket}
# Ex:
#  Get owner (user) of a bucket:
#   radosgw-admin metadata get bucket:my-bucket | awk -F'"' '/owner/ {print $4}'

Detail of a user:

radosgw-admin metadata get user:{user}
# Ex:
#  Get access/secret key of a user:
#   radosgw-admin metadata get user:my-user | awk '/(access|secret)_key/' | sed 's/"\|,//g'

Create user:

radosgw-admin user create \
  --uid={username} \
  --display-name="{display-name}"

Bucket stats:

radosgw-admin bucket stats (--bucket {bucket-name})

Change bucket owner:

radosgw-admin bucket link --bucket={bucket-name} --uid={user}

Pool/Placement

Create Pool:

ceph osd pool create {pool-name} {number-of-objects}
# Ex: ceph osd pool create rgw.buckets.loko.data 32

Enable application on a pool:

ceph osd pool application enable {pool} {app-name (cephfs|rbd|rgw)}
# Ex: ceph osd pool application enable pool.data rgw

Get current zone/zonegroup:

radosgw-admin zone get
radosgw-admin zonegroup get

Create Zonegroup Placement:

radosgw-admin zonegroup placement add \
  --rgw-zonegroup="{zonegroup-name}" \
  --placement-id="{placement-name}"
# Ex: radosgw-admin zonegroup placement add \
#       --rgw-zonegroup="prod" \
#       --placement-id="loko"

Create Zone Placement:

radosgw-admin zone placement add \
  --rgw-zone stime \
  --placement-id="{placement-name}" \
  --data-pool="{data-pool}" \
  --index-pool="{index-pool}" \
  --data-extra-pool="{data-extra-pool}"
# Ex: radosgw-admin zone placement add \
#       --rgw-zone paris \
#       --placement-id="loko" \
#       --data-pool="rgw.buckets.loko.data" \
#       --index-pool="rgw.buckets.index" \
#       --data-extra-pool="rgw.buckets.non-ec"

Others

List zone (region):

radosgw-admin zone list

Commit modification:

radosgw-admin period update --commit

List queue of Garbage Collector:

radosgw-admin gc list --include-all

Procedure

Debug Mode

Add the following under the rgw section of the /etc/ceph/ceph.conf file of Rados gateway node:

debug ms = 1
debug rgw = 20

Restart service:

systemctl restart ceph-radosgw@{service_name}.service
  • https://docs.ceph.com/en/latest/radosgw/admin/
  • https://docs.ceph.com/en/latest/man/8/radosgw-admin/
Back to top