This article will outline how to create an Erasure Code Pool in the Ceph Dashboard along with configuring the Erasure Code Profile necessary for the pool to use.
- An existing ceph cluster
- Ceph Filesystem configured on your existing ceph cluster**
**If the Erasure Code pool is to be used for RBD storage only, you do not need the ceph filesystem up and running on your cluster.
1. Go to your ceph dashboard and go to the “Pools” section
2. Click “Create” to start creating a new pool
- For Pool type, select “erasure” from the drop down list
- For Placement Groups(PGs), it’s best to start low, such as 64, and allow auto-scale to add more PGs to the pool as needed
- For Erasure Code Proile, the default value is 2+1. If you’re in need of a different profile, click the “+” button to create a new profile.
For this example, we’ll be creating a 4 + 2 EC profile.
When creating a profile:
- Your “Data Chunks” will be the first number in the EC profile, in this example, that is “4”.
- Your “Coding Chunks” will be the second number in the EC profile, in this example, that is “2”.
- The Crush Failure Domain will stay at host level***
Unless a custom Crush Map of the data on the cluster is being used.***
Once you have your EC profile created, you will select it from a drop down list for “Erasure code profile” and select your Applications for the pool you are creating. Where in this example, we are creating a pool for filesystem access (ceph, SMB, NFS), we are selecting “cephfs”.
Once the EC profile is created, select it from the “Erasure Code Profile” drop down menu. Select the Applications for the pool you’re creating. In this example, a pool for filesystem access is being created, which includes Ceph, SMB and NFS, so select “cephfs”.
Once these values are input, click “CreatePool”. This will create the pool.
The newly created pool will need to be added to the cephfs filesystem for use with any shares that have been created or planned to be created.
- Log into any nodes of the ceph cluster and run the following command:
ceph fs add_data_pool cephfs data_ec
- Once the pool has been successfully added, it can be verified by checking the Filesystems section of the Ceph Dashboard. Check for pools that are available under “cephfs”.
The existing Ceph filesystem will need to be mounted for the filesystem to be able to use the newly created Erasured Coded pool for storage.
setfattr -n ceph.dir.layout.pool -v data_ec /mnt/localceph
- Run the following command on the mount location of the filesystem:
getfattr -n ceph.dir.layout /mnt/localceph
The output from this command, “pool=data_ec” confirms the filesystem is using the Erasure Coded pool that has been created for storage.
- If “setfattr” or “getfattr” commands fail, the “attr” package may need to be installed: yum install attr