Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jakoberpf/f9ae767a5d76e9acaf8119103bfa2067 to your computer and use it in GitHub Desktop.
Save jakoberpf/f9ae767a5d76e9acaf8119103bfa2067 to your computer and use it in GitHub Desktop.
Cheatsheet how to setup a erasure coding pool, add it to a ceph filesystem and configure files/directories to use the ec pool.

[manual] create erasure-coding ceph filesystem pool

Cheatsheet how to setup a erasure coding pool, add it to a ceph filesystem and configure files/directories to use the ec pool.

root@ceph:~$ ceph osd erasure-code-profile set ec-62-profile k=6 m=2 crush-failure-domain=osd crush-device-class=hdd
root@ceph:~$ ceph osd pool create glacier_data_ec-62 erasure ec-62-profile
root@ceph:~$ ceph osd pool set glacier_data_ec-62 allow_ec_overwrites true
root@ceph:~$ ceph osd pool application enable glacier_data_ec-62 cephfs
root@ceph:~$ ceph fs add_data_pool glacier glacier_data_ec-62

Managing ceph dir/file layouts

Files

root@ceph:~$ touch file
root@ceph:~$ getfattr -n ceph.file.layout file
# file: file
ceph.file.layout="stripe_unit=4194304 stripe_count=1 object_size=4194304 pool=glacier_data"
root@ceph:~$ setfattr -n ceph.file.layout.pool -v glacier_data_ec-62 file 
root@ceph:~$ getfattr -n ceph.file.layout file
# file: file
ceph.file.layout="stripe_unit=4194304 stripe_count=1 object_size=4194304 pool=glacier_data_ec-62"

Directories

root@ceph:~$ mkdir directory
root@ceph:~$ getfattr -n ceph.dir.layout directory
directory: ceph.dir.layout: No such attribute
root@ceph:~$ setfattr -n ceph.dir.layout.pool -v glacier_data_ec-62 directory
root@ceph:~$ getfattr -n ceph.dir.layout directory
# file: directory
ceph.dir.layout="stripe_unit=4194304 stripe_count=1 object_size=4194304 pool=glacier_data_ec-62"

Sources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment