]> git.proxmox.com Git - ceph.git/blame - ceph/doc/dev/erasure-coded-pool.rst
update ceph source to reef 18.2.1
[ceph.git] / ceph / doc / dev / erasure-coded-pool.rst
CommitLineData
7c673cae
FG
1Erasure Coded pool
2==================
3
4Purpose
5-------
6
7Erasure-coded pools require less storage space compared to replicated
8pools. The erasure-coding support has higher computational requirements and
9only supports a subset of the operations allowed on an object (for instance,
10partial write is not supported).
11
12Use cases
13---------
14
15Cold storage
16~~~~~~~~~~~~
17
18An erasure-coded pool is created to store a large number of 1GB
19objects (imaging, genomics, etc.) and 10% of them are read per
20month. New objects are added every day and the objects are not
21modified after being written. On average there is one write for 10,000
22reads.
23
24A replicated pool is created and set as a cache tier for the
25erasure coded pool. An agent demotes objects (i.e. moves them from the
26replicated pool to the erasure-coded pool) if they have not been
27accessed in a week.
28
b32b8144 29The erasure-coded pool CRUSH rule targets hardware designed for
7c673cae 30cold storage with high latency and slow access time. The replicated
b32b8144 31pool CRUSH rule targets faster hardware to provide better response
7c673cae
FG
32times.
33
34Cheap multidatacenter storage
35~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
36
37Ten datacenters are connected with dedicated network links. Each
38datacenter contains the same amount of storage with no power-supply
39backup and no air-cooling system.
40
b32b8144 41An erasure-coded pool is created with a CRUSH rule that will
7c673cae
FG
42ensure no data loss if at most three datacenters fail
43simultaneously. The overhead is 50% with erasure code configured to
44split data in six (k=6) and create three coding chunks (m=3). With
45replication the overhead would be 400% (four replicas).
46
47Interface
48---------
49
50Set up an erasure-coded pool::
51
9f95a23c 52 $ ceph osd pool create ecpool erasure
7c673cae 53
b32b8144 54Set up an erasure-coded pool and the associated CRUSH rule ``ecrule``::
7c673cae 55
b32b8144 56 $ ceph osd crush rule create-erasure ecrule
9f95a23c 57 $ ceph osd pool create ecpool erasure default ecrule
7c673cae 58
b32b8144 59Set the CRUSH failure domain to osd (instead of host, which is the default)::
7c673cae
FG
60
61 $ ceph osd erasure-code-profile set myprofile \
224ce89b 62 crush-failure-domain=osd
7c673cae
FG
63 $ ceph osd erasure-code-profile get myprofile
64 k=2
9f95a23c 65 m=2
7c673cae
FG
66 plugin=jerasure
67 technique=reed_sol_van
224ce89b 68 crush-failure-domain=osd
9f95a23c 69 $ ceph osd pool create ecpool erasure myprofile
7c673cae
FG
70
71Control the parameters of the erasure code plugin::
72
73 $ ceph osd erasure-code-profile set myprofile \
9f95a23c 74 k=3 m=2
7c673cae
FG
75 $ ceph osd erasure-code-profile get myprofile
76 k=3
9f95a23c 77 m=2
7c673cae
FG
78 plugin=jerasure
79 technique=reed_sol_van
9f95a23c 80 $ ceph osd pool create ecpool erasure myprofile
7c673cae
FG
81
82Choose an alternate erasure code plugin::
83
84 $ ceph osd erasure-code-profile set myprofile \
85 plugin=example technique=xor
86 $ ceph osd erasure-code-profile get myprofile
87 k=2
9f95a23c 88 m=2
7c673cae
FG
89 plugin=example
90 technique=xor
91 $ ceph osd pool create ecpool 12 12 erasure \
92 myprofile
93
94Display the default erasure code profile::
95
96 $ ceph osd erasure-code-profile ls
97 default
98 $ ceph osd erasure-code-profile get default
99 k=2
9f95a23c 100 m=2
7c673cae
FG
101 plugin=jerasure
102 technique=reed_sol_van
103
104Create 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::
105
106 $ ceph osd erasure-code-profile set myprofile k=3 m=3
107 $ ceph osd erasure-code-profile get myprofile
108 k=3
109 m=3
110 plugin=jerasure
111 technique=reed_sol_van
112 $ ceph osd erasure-code-profile ls
113 default
114 myprofile
115
116Remove a profile that is no longer in use (otherwise it will fail with EBUSY)::
117
118 $ ceph osd erasure-code-profile ls
119 default
120 myprofile
121 $ ceph osd erasure-code-profile rm myprofile
122 $ ceph osd erasure-code-profile ls
123 default
124
b32b8144 125Set the rule to ssd (instead of default)::
7c673cae
FG
126
127 $ ceph osd erasure-code-profile set myprofile \
224ce89b 128 crush-root=ssd
7c673cae
FG
129 $ ceph osd erasure-code-profile get myprofile
130 k=2
9f95a23c 131 m=2
7c673cae
FG
132 plugin=jerasure
133 technique=reed_sol_van
224ce89b 134 crush-root=ssd
7c673cae 135