我要评分
获取效率
正确性
完整性
易理解

Enabling SPDK

Compile the SPDK module in the compilation container to replace the default SPDK module in Ceph, thereby improving OSD performance.

  1. Access the compilation container.
    1
    podman exec -it openeuler2203sp4_build /bin/bash
    
  2. In the /home directory, download ceph-17.2.7 source code.
    1
    2
    cd /home
    wget https://download.ceph.com/tarballs/ceph-17.2.7.tar.gz --no-check-certificate
    
  3. In the /home directory, download the SPDK code from the openEuler community and compile the code.
    1
    2
    3
    4
    cd /home/
    git clone -b openEuler-22.03-LTS-SP4 https://gitee.com/src-openeuler/spdk.git
    cd spdk/
    rpmbuild -bp -D "_sourcedir `pwd`" -D "_builddir `pwd`" spdk.spec
    
  4. In the /home directory, download the DPDK code from the openEuler community and compile the code.
    1
    2
    3
    4
    cd /home/
    git clone -b openEuler-22.03-LTS-SP4 https://gitee.com/src-openeuler/dpdk.git
    cd dpdk/
    rpmbuild -bp -D "_sourcedir `pwd`" -D "_builddir `pwd`" dpdk.spec
    
  5. Replace the DPDK module in the SPDK code with that compiled in previous step.
    cd /home
    rm -rf spdk/spdk-21.01.1/dpdk/
    cp -r dpdk/dpdk-21.11 spdk/spdk-21.01.1/dpdk
  6. In the /home directory, download the isa-l code from the openEuler community, compile the code, and use the generated isa-l module to replace the native one in the SPDK code.
    1
    2
    3
    4
    5
    6
    7
    8
    cd /home
    git clone -b openEuler-22.03-LTS-SP4 https://gitee.com/src-openeuler/isa-l.git
    cd isa-l
    tar -zxvf v2.30.0.tar.gz
    
    cd /home
    rm -rf spdk/spdk-21.01.1/isa-l/
    cp -r isa-l/isa-l-2.30.0/ spdk/spdk-21.01.1/isa-l
    
  7. In the /home directory, download the selinux-policy code. The packaging result can be temporarily stored in /root/rpmbuild/RPMS/noarch.
    • You need to manually compile selinux-policy only when openEuler-22.03-LTS-SP3 and Ceph 17.2.8 are used.
    • Ceph 17.2.8 requires selinux-policy 35.5-22 or later. The openEuler community does not release the RPM package of this version in openEuler-22.03-LTS-SP3. Therefore, a manual compilation is required.
    • If you use openEuler-22.03-LTS-SP4, skip this step.
    • If you use Ceph 17.2.7 or earlier, skip this step.
    1
    2
    3
    4
    5
    6
    cd /home
    git clone https://gitee.com/src-openeuler/selinux-policy.git
    git checkout -b 2203sp3 origin/openEuler-22.03-LTS-SP3
    cp -r selinux-policy/* /root/rpmbuild/SOURCES/
    cp selinux-policy/selinux-policy.spec /root/rpmbuild/SPECS/
    rpmbuild -bb /root/rpmbuild/SPECS/selinux-policy.spec
    
  8. Decompress Ceph source code in the /home directory and move the openEuler SPDK code to the ceph-17.2.7/src directory.
    1
    2
    3
    4
    cd /home
    tar -zxvf ceph-17.2.7.tar.gz
    rm -rf ceph-17.2.7/src/spdk
    cp -r spdk/spdk-21.01.1 ceph-17.2.7/src/spdk
    
  9. Place the ceph-17.2.7-spdk.patch file in the ceph-17.2.7 directory and apply the SPDK patch.
    1
    2
    cd ceph-17.2.7
    patch -p1 < ceph-17.2.7-spdk.patch
    
    You can run the podman cp command to copy files from a physical machine to the container.
    podman cp ./ceph-17.2.7-spdk.patch openeuler2203sp4_build:/home/ceph-17.2.7
  10. After the preceding steps are complete, compile Ceph. For details, see Compiling Ceph.