1 .. _erasure-code-profiles:
7 Erasure code is defined by a **profile** and is used when creating an
8 erasure coded pool and the associated CRUSH rule.
10 The **default** erasure code profile (which is created when the Ceph
11 cluster is initialized) will split the data into 2 equal-sized chunks,
12 and have 2 parity chunks of the same size. It will take as much space
13 in the cluster as a 2-replica pool but can sustain the data loss of 2
14 chunks out of 4. It is described as a profile with **k=2** and **m=2**,
15 meaning the information is spread over four OSD (k+m == 4) and two of
18 To improve redundancy without increasing raw storage requirements, a
19 new profile can be created. For instance, a profile with **k=10** and
20 **m=4** can sustain the loss of four (**m=4**) OSDs by distributing an
21 object on fourteen (k+m=14) OSDs. The object is first divided in
22 **10** chunks (if the object is 10MB, each chunk is 1MB) and **4**
23 coding chunks are computed, for recovery (each coding chunk has the
24 same size as the data chunk, i.e. 1MB). The raw space overhead is only
25 40% and the object will not be lost even if four OSDs break at the
28 .. _list of available plugins:
39 osd erasure-code-profile set
40 ============================
42 To create a new erasure code profile::
44 ceph osd erasure-code-profile set {name} \
45 [{directory=directory}] \
47 [{stripe_unit=stripe_unit}] \
53 ``{directory=directory}``
55 :Description: Set the **directory** name from which the erasure code
60 :Default: /usr/lib/ceph/erasure-code
64 :Description: Use the erasure code **plugin** to compute coding chunks
65 and recover missing chunks. See the `list of available
66 plugins`_ for more information.
72 ``{stripe_unit=stripe_unit}``
74 :Description: The amount of data in a data chunk, per stripe. For
75 example, a profile with 2 data chunks and stripe_unit=4K
76 would put the range 0-4K in chunk 0, 4K-8K in chunk 1,
77 then 8K-12K in chunk 0 again. This should be a multiple
78 of 4K for best performance. The default value is taken
79 from the monitor config option
80 ``osd_pool_erasure_code_stripe_unit`` when a pool is
81 created. The stripe_width of a pool using this profile
82 will be the number of data chunks multiplied by this
90 :Description: The semantic of the remaining key/value pairs is defined
91 by the erasure code plugin.
98 :Description: Override an existing profile by the same name, and allow
99 setting a non-4K-aligned stripe_unit.
104 osd erasure-code-profile rm
105 ============================
107 To remove an erasure code profile::
109 ceph osd erasure-code-profile rm {name}
111 If the profile is referenced by a pool, the deletion will fail.
113 osd erasure-code-profile get
114 ============================
116 To display an erasure code profile::
118 ceph osd erasure-code-profile get {name}
120 osd erasure-code-profile ls
121 ===========================
123 To list the names of all erasure code profiles::
125 ceph osd erasure-code-profile ls