Rate This Document
Findability
Accuracy
Completeness
Readability

Compiling Ceph

  1. Download the ceph-17.2.7 source code.
    1
    wget https://download.ceph.com/tarballs/ceph-17.2.7.tar.gz --no-check-certificate
    
  2. Apply the UCX patch by placing ceph-17.2.7-ucx.patch in the corresponding directory.
    1
    2
    3
    tar -zxvf ceph-17.2.7.tar.gz
    cd ceph-17.2.7
    patch -p1 < ceph-17.2.7-ucx.patch
    
  3. Modify the ceph.spec file (required if the OS is openEuler).
    1
    2
    3
    4
    5
    6
    sed -i 's/redhat-rpm-config/openEuler-rpm-config/g' ceph.spec
    sed -i 's#%if 0%{?fedora} || 0%{?rhel}#%if 0%{?fedora} || 0%{?rhel} || 0%{?openEuler}#' ceph.spec
    sed -i 's#%if 0%{?rhel} || 0%{?fedora}#%if 0%{?rhel} || 0%{?fedora} || 0%{?openEuler}#' ceph.spec
    sed -i '1a\%define _binaries_in_noarch_packages_terminate_build 0' ceph.spec
    sed -i '2a\%define _unpackaged_files_terminate_build 0' ceph.spec
    sed -i 's/DWITH_GRAFANA:BOOL=ON/DWITH_GRAFANA:BOOL=ON \\\n    \-DWITH_UCX=\/usr/g' ceph.spec
    
  4. Compile Ceph.
    1
    2
    3
    4
    5
    6
    7
    8
    cd ..
    tar cfv ceph-17.2.7.tar.bz2 ceph-17.2.7/
    cp ceph-17.2.7/ceph.spec /root/rpmbuild/SPECS/
    cp ceph-17.2.7.tar.bz2 /root/rpmbuild/SOURCES/
    rpmbuild -bb /root/rpmbuild/SPECS/ceph.spec
    
    mv /root/rpmbuild/RPMS/aarch64/* /home/local_rpm/
    mv /root/rpmbuild/RPMS/noarch/* /home/local_rpm/
    
  5. Import the generated RPM packages to the release container on the physical machine.
    1
    podman cp openeuler2203sp3_build:/home/local_rpm openeuler2203sp3_release:/home/
    

If the Ceph source code src/osd/SnapMapper.cc conflicts with the fmt package version, a compilation error is reported. In this case, modify the fmt::format code lines in the src/osd/SnapMapper.cc file as follows: