Erasure Coded pool

Purpose

Erasure-coded pools require less storage space compared to replicatedpools. The erasure-coding support has higher computational requirements andonly supports a subset of the operations allowed on an object (for instance,partial write is not supported).

Use cases

Cold storage

An erasure-coded pool is created to store a large number of 1GBobjects (imaging, genomics, etc.) and 10% of them are read permonth. New objects are added every day and the objects are notmodified after being written. On average there is one write for 10,000reads.

A replicated pool is created and set as a cache tier for theerasure coded pool. An agent demotes objects (i.e. moves them from thereplicated pool to the erasure-coded pool) if they have not beenaccessed in a week.

The erasure-coded pool CRUSH rule targets hardware designed forcold storage with high latency and slow access time. The replicatedpool CRUSH rule targets faster hardware to provide better responsetimes.

Cheap multidatacenter storage

Ten datacenters are connected with dedicated network links. Eachdatacenter contains the same amount of storage with no power-supplybackup and no air-cooling system.

An erasure-coded pool is created with a CRUSH rule that willensure no data loss if at most three datacenters failsimultaneously. The overhead is 50% with erasure code configured tosplit data in six (k=6) and create three coding chunks (m=3). Withreplication the overhead would be 400% (four replicas).

Interface

Set up an erasure-coded pool:

  1. $ ceph osd pool create ecpool erasure

Set up an erasure-coded pool and the associated CRUSH rule ecrule:

  1. $ ceph osd crush rule create-erasure ecrule
  2. $ ceph osd pool create ecpool erasure default ecrule

Set the CRUSH failure domain to osd (instead of host, which is the default):

  1. $ ceph osd erasure-code-profile set myprofile \
  2. crush-failure-domain=osd
  3. $ ceph osd erasure-code-profile get myprofile
  4. k=2
  5. m=2
  6. plugin=jerasure
  7. technique=reed_sol_van
  8. crush-failure-domain=osd
  9. $ ceph osd pool create ecpool erasure myprofile

Control the parameters of the erasure code plugin:

  1. $ ceph osd erasure-code-profile set myprofile \
  2. k=3 m=2
  3. $ ceph osd erasure-code-profile get myprofile
  4. k=3
  5. m=2
  6. plugin=jerasure
  7. technique=reed_sol_van
  8. $ ceph osd pool create ecpool erasure myprofile

Choose an alternate erasure code plugin:

  1. $ ceph osd erasure-code-profile set myprofile \
  2. plugin=example technique=xor
  3. $ ceph osd erasure-code-profile get myprofile
  4. k=2
  5. m=2
  6. plugin=example
  7. technique=xor
  8. $ ceph osd pool create ecpool 12 12 erasure \
  9. myprofile

Display the default erasure code profile:

  1. $ ceph osd erasure-code-profile ls
  2. default
  3. $ ceph osd erasure-code-profile get default
  4. k=2
  5. m=2
  6. plugin=jerasure
  7. technique=reed_sol_van

Create a profile to set the data to be distributed on six OSDs (k+m=6) and sustain the loss of three OSDs (m=3) without losing data:

  1. $ ceph osd erasure-code-profile set myprofile k=3 m=3
  2. $ ceph osd erasure-code-profile get myprofile
  3. k=3
  4. m=3
  5. plugin=jerasure
  6. technique=reed_sol_van
  7. $ ceph osd erasure-code-profile ls
  8. default
  9. myprofile

Remove a profile that is no longer in use (otherwise it will fail with EBUSY):

  1. $ ceph osd erasure-code-profile ls
  2. default
  3. myprofile
  4. $ ceph osd erasure-code-profile rm myprofile
  5. $ ceph osd erasure-code-profile ls
  6. default

Set the rule to ssd (instead of default):

  1. $ ceph osd erasure-code-profile set myprofile \
  2. crush-root=ssd
  3. $ ceph osd erasure-code-profile get myprofile
  4. k=2
  5. m=2
  6. plugin=jerasure
  7. technique=reed_sol_van
  8. crush-root=ssd