2014-03-04 08:52:11 +00:00
|
|
|
Erasure Coded pool
|
|
|
|
==================
|
|
|
|
|
|
|
|
Purpose
|
|
|
|
-------
|
|
|
|
|
2014-04-03 18:24:33 +00:00
|
|
|
Erasure-coded pools require less storage space compared to replicated
|
|
|
|
pools. The erasure-coding support has higher computational requirements and
|
|
|
|
only supports a subset of the operations allowed on an object (for instance,
|
|
|
|
partial write is not supported).
|
2014-03-04 08:52:11 +00:00
|
|
|
|
|
|
|
Use cases
|
|
|
|
---------
|
|
|
|
|
|
|
|
Cold storage
|
|
|
|
~~~~~~~~~~~~
|
|
|
|
|
2014-04-03 18:24:33 +00:00
|
|
|
An erasure-coded pool is created to store a large number of 1GB
|
2014-03-04 08:52:11 +00:00
|
|
|
objects (imaging, genomics, etc.) and 10% of them are read per
|
|
|
|
month. New objects are added every day and the objects are not
|
|
|
|
modified after being written. On average there is one write for 10,000
|
|
|
|
reads.
|
|
|
|
|
|
|
|
A replicated pool is created and set as a cache tier for the
|
2014-11-19 10:06:31 +00:00
|
|
|
erasure coded pool. An agent demotes objects (i.e. moves them from the
|
2014-04-03 18:24:33 +00:00
|
|
|
replicated pool to the erasure-coded pool) if they have not been
|
2014-03-04 08:52:11 +00:00
|
|
|
accessed in a week.
|
|
|
|
|
2014-04-03 18:24:33 +00:00
|
|
|
The erasure-coded pool crush ruleset targets hardware designed for
|
2014-03-04 08:52:11 +00:00
|
|
|
cold storage with high latency and slow access time. The replicated
|
|
|
|
pool crush ruleset targets faster hardware to provide better response
|
|
|
|
times.
|
|
|
|
|
|
|
|
Cheap multidatacenter storage
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
Ten datacenters are connected with dedicated network links. Each
|
2014-04-03 18:24:33 +00:00
|
|
|
datacenter contains the same amount of storage with no power-supply
|
|
|
|
backup and no air-cooling system.
|
2014-03-04 08:52:11 +00:00
|
|
|
|
2014-04-03 18:24:33 +00:00
|
|
|
An erasure-coded pool is created with a crush map ruleset that will
|
2014-03-04 08:52:11 +00:00
|
|
|
ensure no data loss if at most three datacenters fail
|
|
|
|
simultaneously. The overhead is 50% with erasure code configured to
|
|
|
|
split data in six (k=6) and create three coding chunks (m=3). With
|
|
|
|
replication the overhead would be 400% (four replicas).
|
|
|
|
|
|
|
|
Interface
|
|
|
|
---------
|
|
|
|
|
2014-04-03 18:24:33 +00:00
|
|
|
Set up an erasure-coded pool::
|
2014-03-04 08:52:11 +00:00
|
|
|
|
2014-04-21 22:43:23 +00:00
|
|
|
$ ceph osd pool create ecpool 12 12 erasure
|
2014-03-04 08:52:11 +00:00
|
|
|
|
2014-04-03 18:24:33 +00:00
|
|
|
Set up an erasure-coded pool and the associated crush ruleset::
|
2014-03-04 08:52:11 +00:00
|
|
|
|
2014-03-16 16:39:51 +00:00
|
|
|
$ ceph osd crush rule create-erasure ecruleset
|
|
|
|
$ ceph osd pool create ecpool 12 12 erasure \
|
|
|
|
default ecruleset
|
2014-03-04 08:52:11 +00:00
|
|
|
|
2014-04-03 18:24:33 +00:00
|
|
|
Set the ruleset failure domain to osd (instead of the host which is the default)::
|
2014-03-04 08:52:11 +00:00
|
|
|
|
2014-03-16 16:39:51 +00:00
|
|
|
$ ceph osd erasure-code-profile set myprofile \
|
|
|
|
ruleset-failure-domain=osd
|
|
|
|
$ ceph osd erasure-code-profile get myprofile
|
|
|
|
k=2
|
|
|
|
m=1
|
|
|
|
plugin=jerasure
|
|
|
|
technique=reed_sol_van
|
|
|
|
ruleset-failure-domain=osd
|
|
|
|
$ ceph osd pool create ecpool 12 12 erasure myprofile
|
2014-03-04 08:52:11 +00:00
|
|
|
|
|
|
|
Control the parameters of the erasure code plugin::
|
|
|
|
|
2014-03-16 16:39:51 +00:00
|
|
|
$ ceph osd erasure-code-profile set myprofile \
|
|
|
|
k=3 m=1
|
|
|
|
$ ceph osd erasure-code-profile get myprofile
|
|
|
|
k=3
|
|
|
|
m=1
|
|
|
|
plugin=jerasure
|
|
|
|
technique=reed_sol_van
|
|
|
|
$ ceph osd pool create ecpool 12 12 erasure \
|
|
|
|
myprofile
|
2014-03-04 08:52:11 +00:00
|
|
|
|
|
|
|
Choose an alternate erasure code plugin::
|
|
|
|
|
2014-03-16 16:39:51 +00:00
|
|
|
$ ceph osd erasure-code-profile set myprofile \
|
|
|
|
plugin=example technique=xor
|
|
|
|
$ ceph osd erasure-code-profile get myprofile
|
|
|
|
k=2
|
|
|
|
m=1
|
|
|
|
plugin=example
|
|
|
|
technique=xor
|
2015-03-26 14:34:31 +00:00
|
|
|
$ ceph osd pool create ecpool 12 12 erasure \
|
2014-03-16 16:39:51 +00:00
|
|
|
myprofile
|
|
|
|
|
|
|
|
Display the default erasure code profile::
|
|
|
|
|
|
|
|
$ ceph osd erasure-code-profile ls
|
|
|
|
default
|
|
|
|
$ ceph osd erasure-code-profile get default
|
|
|
|
k=2
|
|
|
|
m=1
|
|
|
|
plugin=jerasure
|
|
|
|
technique=reed_sol_van
|
|
|
|
|
2014-08-05 05:05:03 +00:00
|
|
|
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::
|
2014-03-16 16:39:51 +00:00
|
|
|
|
|
|
|
$ ceph osd erasure-code-profile set myprofile k=3 m=3
|
|
|
|
$ ceph osd erasure-code-profile get myprofile
|
|
|
|
k=3
|
|
|
|
m=3
|
|
|
|
plugin=jerasure
|
|
|
|
technique=reed_sol_van
|
|
|
|
$ ceph osd erasure-code-profile ls
|
|
|
|
default
|
|
|
|
myprofile
|
|
|
|
|
|
|
|
Remove a profile that is no longer in use (otherwise it will fail with EBUSY)::
|
|
|
|
|
|
|
|
$ ceph osd erasure-code-profile ls
|
|
|
|
default
|
|
|
|
myprofile
|
|
|
|
$ ceph osd erasure-code-profile rm myprofile
|
|
|
|
$ ceph osd erasure-code-profile ls
|
|
|
|
default
|
2014-04-11 11:51:46 +00:00
|
|
|
|
|
|
|
Set the ruleset to take ssd (instead of default)::
|
|
|
|
|
|
|
|
$ ceph osd erasure-code-profile set myprofile \
|
|
|
|
ruleset-root=ssd
|
|
|
|
$ ceph osd erasure-code-profile get myprofile
|
|
|
|
k=2
|
|
|
|
m=1
|
|
|
|
plugin=jerasure
|
|
|
|
technique=reed_sol_van
|
|
|
|
ruleset-root=ssd
|
|
|
|
|