Skip to content

Instantly share code, notes, and snippets.

@wido
Created February 27, 2019 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wido/9f136130352b2685c9709bc2d282fc6d to your computer and use it in GitHub Desktop.
Save wido/9f136130352b2685c9709bc2d282fc6d to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# Fetch the amount of shards a Ceph RADOS Gateway bucket has
#
# Author: Wido den Hollander <wido@denhollander.io>
#
BUCKET=$1
ID=$(radosgw-admin bucket stats --bucket=${BUCKET}|jq -r '.id')
SHARDS=$(radosgw-admin metadata get bucket.instance:${BUCKET}:${ID}|jq '.data.bucket_info.num_shards')
echo $SHARDS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment