编译Ceph
- 下载ceph-17.2.7源码。
wget https://download.ceph.com/tarballs/ceph-17.2.7.tar.gz --no-check-certificate
- 合入UCX patch(将ceph-17.2.7-ucx.patch放入对应目录下)。
tar -zxvf ceph-17.2.7.tar.gz cd ceph-17.2.7 patch -p1 < ceph-17.2.7-ucx.patch
- 修改ceph.spec文件(欧拉系统)。
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
- 编译Ceph。
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/
- 在物理机上将编好的RPM包导入到出包容器。
podman cp openeuler2203sp3_build:/home/local_rpm openeuler2203sp3_release:/home/
若Ceph源码src/osd/SnapMapper.cc与fmt包的版本不匹配时,会出现编译报错。报错时需要将src/osd/SnapMapper.cc文件中fmt::format相关代码行修改,修改类似如下。
父主题: 编译Ceph软件包