Skip to content

Instantly share code, notes, and snippets.

@yuvalif
Last active January 2, 2022 18:01
Show Gist options
  • Select an option

  • Save yuvalif/2e8e926a6bb8ab280ce5e01b60506836 to your computer and use it in GitHub Desktop.

Select an option

Save yuvalif/2e8e926a6bb8ab280ce5e01b60506836 to your computer and use it in GitHub Desktop.

vstart

  • start:
MON=1 OSD=1 MDS=0 MGR=0 RGW=1 ../src/vstart.sh -n -d
  • create a bucket
hsbench -a 0555b35654ad1656d804 -s h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q== -u http://localhost:8000 -bp my-bucket -b 1 -r default -m i
  • set quota for all buckets and enable it:
bin/radosgw-admin -c ceph.conf quota set --uid=testid --quota-scope=bucket --max-objects=1024
bin/radosgw-admin -c ceph.conf quota enable --quota-scope=bucket --uid=testid
  • verify bucket quota was set for user:
bin/radosgw-admin -c ceph.conf user info --uid=testid | jq .bucket_quota
  • upload objects until quota is reached:
hsbench -a 0555b35654ad1656d804 -s h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q== -u http://localhost:8000 -bp my-bucket -b 1 -r default -m p -z 4K -d 40 -op obj1
  • verify that the quota was not exceeded for the bucket:
bin/radosgw-admin -c ceph.conf bucket stats --bucket=my-bucket000000000000 | jq .usage

multisite

  • start:
MON=1 OSD=1 MDS=0 MGR=0 ../src/test/rgw/test-rgw-multisite.sh 2
  • create the bucket:
hsbench -a 1234567890 -s pencil -u http://localhost:8001 -bp my-bucket -b 1 -r zg1 -m i
  • set quota for all buckets and enable it:
bin/radosgw-admin -c run/c1/ceph.conf quota set --uid=zone.user --quota-scope=bucket --max-objects=1024
bin/radosgw-admin -c run/c1/ceph.conf quota enable --quota-scope=bucket --uid=zone.user
  • verify bucket quota was set for user:
bin/radosgw-admin -c run/c1/ceph.conf user info --uid=zone.user | jq .bucket_quota
  • upload objects until quota is reached:
hsbench -a 1234567890 -s pencil -u http://localhost:8001 -bp my-bucket -b 1 -r zg1 -m p -z 4K -d 40 -op obj1
  • for a specific bucket, use:
bin/radosgw-admin -c run/c1/ceph.conf quota set --bucket=my-bucket000000000000 --max-objects=1024
bin/radosgw-admin -c run/c1/ceph.conf quota enable --bucket=my-bucket000000000000
  • and verify with:
bin/radosgw-admin -c run/c1/ceph.conf bucket stats --bucket=my-bucket000000000000 | jq .bucket_quota
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment