This page will give an example to create a erasure code pool and make one user to use it.


Prepare:

  1. running ceph cluster
  2. already running rgw service
  3. uvs support



Step 1:  Create ec pool

ceph osd pool create taiwan.rgw.buckets.data.cold 128 128 erasure ec42_osd_hdd
ceph osd pool application enable taiwan.rgw.buckets.data.cold rgw

Step 2: Create cold placement rule

# create cold placement
radosgw-admin zonegroup placement add \
        --rgw-zonegroup asia \
        --placement-id cold-placement
# add cold into zone with ec pool
radosgw-admin zone placement add \
        --rgw-zone taiwan \
        --placement-id cold-placement \
        --storage-class STANDARD \
        --index-pool taiwan.rgw.buckets.index \
        --data-pool taiwan.rgw.buckets.data.cold \
        --data-extra-pool taiwan.rgw.buckets.non-ec
# tips: can add compress for rule
# radosgw-admin zone placement add \
        --rgw-zone taiwan \
        --placement-id cold-placement \
        --storage-class STANDARD \
        --index-pool taiwan.rgw.buckets.index \
        --data-pool taiwan.rgw.buckets.data.cold \
        --data-extra-pool taiwan.rgw.buckets.non-ec \
        --compression lz4
# update commit
radosgw-admin period update --commit

Step 3: Update user use new placement

# create hctang-cold at uvs
 radosgw-admin user modify \
      --uid hctang-cold \
      --placement-id cold-placement

Tips: AWS s3api commands:

# create new bucket with COLD storage class 
aws s3api --profile cold create-bucket --bucket cold --acl private --object-lock-enabled-for-bucket

# put data
aws s3api --profile cold put-object --bucket cold --key nfs/custom2.iso --body ./gen.iso