EC Turbo Feature Guide
EC Turbo is a Huawei-developed feature library for optimizing the performance of Ceph erasure-coded storage pools. EC Turbo improves the I/O read and write performance for data whose length is within a stripe. This document describes how to enable EC Turbo on Ceph.
This feature is released with Kunpeng BoostKit 21.0.0.
Pay attention to the vulnerabilities reported on the Ceph official website and Ceph GitHub, and fix the vulnerabilities as required.
| Item | Specifications |
|---|---|
| CPU | Kunpeng 920 |
EC Turbo is available only for Kunpeng processors.
| Software | Version |
|---|---|
| OS | openEuler 20.03 LTS SP1 |
| Ceph | Ceph 14.2.8 |
Currently, EC Turbo adapts only to Ceph 14.2.8. If this feature needs to be used in other versions, you can modify the corresponding version based on open-source patches and APIs of this feature.
EC Turbo can be used to optimize the performance of erasure-coded data storage pools.
Ceph data storage pools are classified into two types: replicated and erasure-coded. EC is a data protection method. The original data is divided into K data blocks (data chunks) that form a stripe, and M redundant blocks (coding chunks) are generated after the data chunks are encoded. You can restore the original data by using any K chunks in the K+M chunks. You can store data chunks and coding chunks in different locations.
Obtaining the EC Turbo Installation Package
Run the
gcc --versioncommand to check the GCC version.gcc --versionDownload the software package.
Download the software package based on the GCC version.
- If the GCC version is earlier than 4.8.1, download BoostKit-ec_1.2.2_abi-cxx-03.zip.
- If the version is 4.8.1 or later, download BoostKit-ec_1.2.2_abi-cxx-11.zip.
The names of the extracted installation packages are
boostkit-ec-1.2.2-1.openeuler.aarch64.rpmandboostkit-sdslog-1.2.2-1.openeuler.aarch64.rpm. Theboostkit-sdsloginstallation package is a dependency of theboostkit-ecinstallation package. Save the RPM packages to the/home/ec_turbodirectory.Install the RPM packages downloaded in step 2.
cd /home/ec_turbo yum install boostkit-ec-1.2.2-1.openeuler.aarch64.rpm boostkit-sdslog-1.2.2-1.openeuler.aarch64.rpmThe following table lists the new files and their locations.
File Directory libkps_ec, libkps_bluestore, libsdslog /usr/lib64 hi_coreutil.h, kps_bluestore.h, sdslog.h, sdslog_param.h /usr/include logrotate_sdslog.conf /etc cron_sdslog /etc/cron.d
Obtaining the Ceph Source Code
Obtain Ceph 14.2.8 source code.
Save the source package to the
/homedirectory on the server and decompress the package.cd /home tar -zxvf ceph-14.2.8.tar.gz
Applying the Ceph EC Patch
If other SDS features need to be added, install patches by referring to the feature guides.
Obtain ceph-14.2.8-ec_turbo-release.patch and save it to
/home/ceph-14.2.8.Back up the original
ceph.specfile. A newceph.specfile will be generated when you apply the patch in the next step.cd /home/ceph-14.2.8 cp ceph.spec ceph.spec.bakApply the patch downloaded in step 1.
git apply --check ceph-14.2.8-ec_turbo-release.patch patch -p1 < ceph-14.2.8-ec_turbo-release.patchWhen applying the patch, src/isa-l-related information in the following figure is displayed. You can ignore the information. This problem can be solved by upgrading isa-l. For details, see the next section.

Building the liboath-devel Package
The openEuler software repository does not include the liboath-devel package. You need to build one.
Download related code and patches.
cd /home/oath wget --no-check-certificate https://gitee.com/src-openeuler/oath-toolkit/repository/archive/openEuler-21.03-20210330.zip unzip openEuler-21.03-20210330.zip cd oath-toolkitInstall dependencies.
yum install gtk-doc pam-devel rpmdevtools rpmdev-setuptreeSave related files to the
/root/rpmbuild/SOURCESdirectory.mv /home/oath-toolkit/0001-oath-toolkit-2.6.5-lockfile.patch oath-toolkit-2.6.5.tar.gz /root/rpmbuild/SOURCES/Build an RPM package.
cd /root/oath-toolkit rpmbuild -bb oath-toolkit.specUse the RPM package as the local Yum repository.
mkdir -p /home/rpm/oath cp -r /root/rpmbuild/RPMS/* /home/rpm/oath/ yum install -y createrepo cd /home/rpm/oath createrepo ./Configure the repository file.
Open the
local.repofile.vi /etc/yum.repos.d/local.repoPress i to enter the insert mode and add the following content to the file:
[local-oath] name=local-oath baseurl=file:///home/rpm/oath enabled=1 gpgcheck=0 priority=1Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
Install liboath dependencies.
yum install liboath liboath-devel -y
Preparing the Compilation Environment
Currently, Ceph cannot be directly compiled on openEuler. You need to perform the following steps for adaptation.
Return to the
ceph-14.2.8directory.cd /home/ceph-14.2.8Open the
install-deps.shfile.vim install-deps.shAdd
openEulerto the file.
Create
libkps_bluestore.soandlibkps_ec.so.cd /usr/lib64/ ln -snf libkps_bluestore.so.1.0.0 libkps_bluestore.so
Compiling and Verifying Ceph
Preparing the Compilation Environment
Open the
yum.conffile.vim /etc/yum.confPress i to enter the insert mode and add
sslverify=falseanddeltarpm=0.
Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
Upgrade isa-l.
The version of isa-l contained in the Ceph 14.2.8 source code is early. Upgrade isa-l.
Go to the
srcdirectory.cd /home/ceph-14.2.8/srcBack up the original isa-l and obtain the latest isa-l 2.29 source code.
mv isa-l isa-l.bak wget https://github.com/intel/isa-l/archive/refs/tags/v2.29.0.tar.gz --no-check-certificate tar -xzvf v2.29.0.tar.gz mv isa-l-2.29.0 isa-lModify some isa-l source code to adapt to AArch64.
For details about the modification, visit GitHub.
In the file, the red lines are to be deleted, and the green lines are to be added and modified.
After the upgrade is complete, the
aarch64directory exists inisa-l/erasure_code/.
Install dependencies.
cd /home/ceph-14.2.8/ sh install-deps.shModify the
do_cmake.shfile.Open the file.
vim do_cmake.shPress i to enter the insert mode and modify the file as follows:
${CMAKE} -DCMAKE_BUILD_TYPE=RelWithDebInfo $ARGS "$@" .. || exit 1
Comment out
git submodule update --init --recursiveto prevent isa-l from being rolled back to the old version when building an RPM package.
Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
Execute
do_cmake.sh.sh do_cmake.shStart the compilation.
The compilation requires GCC 7 or later. Make the compilation environment ready.
{number}in the following commands indicates the number of jobs during compilation. Generally, a larger value indicates a faster compilation speed. However, the value cannot exceed the number of CPU cores.cd /home/ceph-14.2.8/build make -j{number}Perform a unit test.
ctest3 -V -R unittest_erasure_code
Delete the
builddirectory.cd /home/ceph-14.2.8/ rm -rf build
Creating a Ceph RPM Package
Install rpmbuild.
yum install rpmdevtools -y rpmdev-setuptreeIf you perform the compilation as the
rootuser, anrpmbuilddirectory is generated in the/rootdirectory. The compilation occupies 20 GB to 30 GB of space. If the/rootdirectory has a smaller space, relocaterpmbuildto another directory, for example,/home.Modify the
.rpmmacrosfile.Open the file.
vim /root/.rpmmacrosPress i to enter the insert mode and set
%_topdirto/home/rpmbuild.
Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
Run the
rpmbuildinstallation command again.rpmdev-setuptreeCopy the
ceph.specfile.cp ceph.spec /home/rpmbuild/SPECS/Copy the source package.
cd /home/ tar -cjvf ceph-14.2.8.tar.bz2 ceph-14.2.8 cp ceph-14.2.8.tar.bz2 /home/rpmbuild/SOURCES/Build RPM packages.
Move
performance.shto the/homedirectory.mv /etc/profile.d/performance.sh /home/ source /etc/profileBuild RPM packages.
rpmbuild -bb /home/rpmbuild/SPECS/ceph.specRestore
performance.sh.mv /home/performance.sh /etc/profile.d/ source /etc/profile
Deploying a Ceph Cluster
Create a local repository.
Create a
/home/ecturbo_rpmdirectory and copy the created RPM packages to the directory.mkdir /home/ecturbo_rpm cp /home/rpmbuild/RPMS/aarch64/* /home/ecturbo_rpm cp /home/rpmbuild/RPMS/noarch/* /home/ecturbo_rpmGo to
/home/ecturbo_rpmand generaterepodata.cd /home/ecturbo_rpm createrepo ./Go to
/etc/yum.repos.dand create amy_ceph_local.repofile.cd /etc/yum.repos.d vim my_ceph_local.repoPress i to enter the insert mode and edit the
my_ceph_local.repofile. Add the information of Ceph and oath.[myceph] name=myceph baseurl=file:///home/ecturbo_rpm enabled=1 gpgcheck=0 [local-oath] name=local-oath baseurl=file:///home/rpm/oath enabled=1 gpgcheck=0Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
Update the Yum cache.
yum clean all yum makecache
Install Ceph.
For details, see Installing the Ceph Software in the Ceph Block Storage Deployment Guide (CentOS 7.6 & openEuler 20.03).
- In the deployment guide, the configured Ceph repository is an official Ceph repository, which is an RPM package that does not contain the EC Turbo feature. Therefore, you need to configure Ceph using the local repository.
- Before installing Ceph, run the
yum list | grep cephcommand to ensure that Ceph is installed from the local repository. In the command,mycephis the name of the repository from which Ceph components are installed. - When installing Ceph, you may need to install other third-party software. Ensure that the network connection is normal.
Enabling the EC Turbo Feature
Enable the EC Turbo feature.
For details about how to create an EC storage pool, see Creating a Storage Pool in the Ceph Object Storage Deployment Guide (CentOS 7.6 & openEuler 20.03).
The
stripe_unitvalue of the EC data pool is 256 KB. Whenk=4andm=2, the stripe size (stripe_width) is 1 MB. EC Turbo optimizes I/Os smaller than 1 MB.EC Turbo uses the isa-l erasure code library. When creating an EC profile, enable the isa-l plugin, that is, add the
plugin=isaparameter. In addition, specifystripe_unit=256KB. The command for creating an EC profile cannot be the command in the reference document. The correct command for creating an EC profile is:ceph osd erasure-code-profile set myprofile k=4 m=2 crush-failure-domain=osd crush-device-class=hdd plugin=isa stripe_unit=256KIf the number of nodes in the cluster is greater than or equal to 6 (
k+m), you can setcrush-failure-domaintohost.
Add the following items to
[global]in theceph.conffile. These parameters can be modified before or after the pool is created.osd_ec_partial_read = true osd_ec_partial_write = true osd_ec_partial_update = true osd_ec_zero_opt = true bluestore_kpsallocator_enable = true- The partial read option conflicts with the fast read option. To enable
osd_ec_partial_read, check thatosd_pool_default_ec_fast_readis disabled (disabled by default). Otherwise, partial read does not take effect. - The default values of the preceding five parameters are
true. If you do not add these parameters toceph.conf, the system uses the default values. To disable the EC Turbo feature, change the values of these parameters inceph.conftofalse. - Run the
ceph daemon osd.<OSD_number> config show | grep -E 'osd_ec_partial_read|osd_ec_partial_write|osd_ec_partial_update|osd_ec_zero_opt|bluestore_kpsallocator_enable'command to check whether the parameters take effect.
Configure EC Turbo log parameters
kpsec_log_fullpath,kpsec_log_level, andkpsec_log_memlogsize.These parameters can be defined in the
[global]section ofceph.conf. If you do not define these parameters, the system uses the default values.The following lists the default values of these parameters.
[global] ...... kpsec_log_fullpath = /var/log/ceph/ kpsec_log_level = CRITICAL/DEBUG kpsec_log_memlogsize = 100 ......- The main services of EC Turbo are encapsulated in the
libkps_ecdynamic library. This dynamic library does not use the Ceph log system. Therefore, configure logging for it. - Generally, Ceph logs are stored in
/var/log/ceph. If another directory is specified, ensure that the Ceph user can read and write the directory. - Log levels are classified into the file log level and memory log level, which must be defined separately. Generally, the content recorded in memory logs is more detailed than that recorded in file logs. The log level must be selected from [
CRITICAL=0,ERROR=1,WARNING=2,INFORMATION=3,DEBUG=4]. The value ofmem_log_sizeranges from 100 to 1000. - If you modify kpsec log parameters when the OSD process is running, restart the OSD process for the modification to take effect.
- If it is inconvenient to restart the OSD process, run the
ceph tell osd.<OSD_number> injectargs --<parameter_name>=<parameter_value>command to modify the parameter online, and then run theceph tell osd.<OSD_number> reload_kps_confcommand to reload kpsec log parameters.
- The main services of EC Turbo are encapsulated in the
Push
ceph.confto each node.ceph-deploy --overwrite-conf admin {node1} {node2}{nodeX}is the name of a Ceph node. You can run the command to pushceph.confto multiple nodes in the cluster at the same time. After the push is complete, restart the cluster.Verify that EC Turbo takes effect.
Change the log level of ceph-osd to
20/20. For example, change the log level of OSD 3:ceph daemon osd.3 config set debug_osd 20/20Perform data read and write in the EC pool. Then view the ceph-osd log numbered 3. If the log contains
partial_write=1 partial_update=1, EC Turbo has taken effect.
Change the log level of ceph-osd to the default value.
ceph daemon osd.3 config set debug_osd 0/1
Managing Logs
Use logrotate and crontab to manage logs.
logrotate is a common log management program on Linux, and crontab is a time-based task management system.
/etc/logrotate_sdslog.conf consists log file management parameters of EC Turbo. This file is installed in a specified directory when EC Turbo is installed. The file content is as follows:
/var/log/ceph/kpsec*.log {
rotate 30
daily
compress
dateext
dateformat.%Y%m%d.%s
size=100M
missingok
su ceph ceph
lastaction
/usr/bin/chmod 440 /var/log/ceph/kpsec*.gz
/usr/bin/chmod 440 /var/log/ceph/kpsec*.log-*
/usr/bin/chmod 440 /var/log/ceph/kpsec*.log.*
endscript
}
/var/log/sdslog*.log {
rotate 30
daily
compress
dateext
dateformat.%Y%m%d.%s
size=100M
missingok
su ceph ceph
lastaction
/usr/bin/chmod 440 /var/log/sdslog*.gz
/usr/bin/chmod 440 /var/log/sdslog*.log-*
/usr/bin/chmod 440 /var/log/sdslog*.log.*
endscript
}
crontab can run a specified task at a fixed time, on a fixed date, or at a fixed interval. Add a task to crontab for logrotate to be executed every minute.
Add the
cron_sdslogfile to the/etc/cron.d/directory. The file content is as follows:*/1 * * * * root /usr/sbin/logrotate /etc/logrotate_sdslog.confChange the permission on
cron_sdslogto600.
Dependencies Missing During Ceph Compilation
During Ceph compilation for enabling the EC Turbo feature, the message Could NOT find LTTngUST (missing: LTTNGUST_LIBRARIES LTTNGUST_INCLUDE_DIRS) is displayed.
Key Process and Cause Analysis
The open-source third-party dependency packages are missing in the environment.
Install the required dependencies based on the error message.
yum install -y lttng-ust-devel keyutils-libs-devel openldap-devel leveldb-devel snappy-devel lz4-devel curl-devel expat-devel openssl-devel libbabeltrace-devel librabbitmq-devel rdma-core-devel python2-Cython python3-Cythonceph-deploy mon create-initial Initialization Failure
ceph-deploy mon create-initial initialization fails.

Key Process and Cause Analysis
None
Add a Ceph user group.
groupadd cephAdd a user.
useradd ceph -g cephReinstall Ceph.
no module named werkzeug.serving Reported After Ceph Status Is Queried
no module named werkzeug.serving is reported after the Ceph status is queried.

Key Process and Cause Analysis
None
Install werkzeug.
pip install werkzeugNo module named OpenSSL Reported When Ceph Status Is Queried
No module named OpenSSL is reported when the Ceph status is queried.

Key Process and Cause Analysis
None
Install OpenSSL.
yum install python2-pyOpenSSL.noarch
yum install python3-pyOpenSSL.noarch Failed to Find Dynamic Libraries During do_cmake.sh Execution and Compilation
The symptom is similar to the following:
kps_bluestorecannot be found.Could Not find kps_bluestore (missing: KPS_BLUESTORE_LIBRARIES) CMake Error at CMakeLists.txt:277 (message): no libkpsbluestore.so found
lkps_eccannot be found.cannot find -lkps_ec collect2: error: ld returned 1 exit status
Key Process and Cause Analysis
None
Create soft links.
ln -snf /usr/lib64/libkps_bluestore.so.1.0.0 /usr/lib64/libkps_bluestore.so ln -snf /usr/lib64/libkps_ec.so.1.2.1 /usr/lib64/libkps_ec.soRun the compile command again.
rm -rf build/ && sh do_cmake.sh
Change History
| Date | Description |
|---|---|
| 2024-12-30 | This is the second official release. Added Ceph all-flash storage support for EC Turbo. |
| 2022-12-17 | This is the first official release. |