ceph服务去除python依赖变更
1、spec文件中python依赖去除
删除ceph工程中ceph.spec.in中所有涉及python的Requires:
例如ceph-selinux包的python依赖:
2、不构建python相关的包
原ceph包(18个) | 去除python依赖后的包(14个) |
ceph-12.2.12-129.g589eac0.el7.centos.x86_64.rpm ceph-base-12.2.12-129.g589eac0.el7.centos.x86_64.rpm ceph-common-12.2.12-129.g589eac0.el7.centos.x86_64.rpm ceph-mds-12.2.12-129.g589eac0.el7.centos.x86_64.rpm ceph-mgr-12.2.12-129.g589eac0.el7.centos.x86_64.rpm ceph-mon-12.2.12-129.g589eac0.el7.centos.x86_64.rpm ceph-osd-12.2.12-129.g589eac0.el7.centos.x86_64.rpm ceph-radosgw-12.2.12-129.g589eac0.el7.centos.x86_64.rpm ceph-selinux-12.2.12-129.g589eac0.el7.centos.x86_64.rpm libcephfs2-12.2.12-129.g589eac0.el7.centos.x86_64.rpm librados2-12.2.12-129.g589eac0.el7.centos.x86_64.rpm libradosstriper1-12.2.12-129.g589eac0.el7.centos.x86_64.rpm librbd1-12.2.12-129.g589eac0.el7.centos.x86_64.rpm librgw2-12.2.12-129.g589eac0.el7.centos.x86_64.rpm python-cephfs-12.2.12-129.g589eac0.el7.centos.x86_64.rpm python-rados-12.2.12-129.g589eac0.el7.centos.x86_64.rpm python-rbd-12.2.12-129.g589eac0.el7.centos.x86_64.rpm python-rgw-12.2.12-129.g589eac0.el7.centos.x86_64.rpm | ceph-12.2.12-131.g3d16618.el7.centos.x86_64.rpm ceph-base-12.2.12-131.g3d16618.el7.centos.x86_64.rpm ceph-common-12.2.12-131.g3d16618.el7.centos.x86_64.rpm ceph-mds-12.2.12-131.g3d16618.el7.centos.x86_64.rpm ceph-mgr-12.2.12-131.g3d16618.el7.centos.x86_64.rpm ceph-mon-12.2.12-131.g3d16618.el7.centos.x86_64.rpm ceph-osd-12.2.12-131.g3d16618.el7.centos.x86_64.rpm ceph-radosgw-12.2.12-131.g3d16618.el7.centos.x86_64.rpm ceph-selinux-12.2.12-131.g3d16618.el7.centos.x86_64.rpm libcephfs2-12.2.12-131.g3d16618.el7.centos.x86_64.rpm librados2-12.2.12-131.g3d16618.el7.centos.x86_64.rpm libradosstriper1-12.2.12-131.g3d16618.el7.centos.x86_64.rpm librbd1-12.2.12-131.g3d16618.el7.centos.x86_64.rpm librgw2-12.2.12-131.g3d16618.el7.centos.x86_64.rpm |
3、去除ceph各服务中带有python脚本的部分(否则主机服务安装时会报 /usr/bin/python2.7 is needed by ceph-xxx.rpm)
服务 | 文件 | 类型 | 来源 | 说明 | 处理办法 |
ceph-osd | /usr/sbin/ceph-volume /usr/sbin/ceph-volume-systemd | python脚本 | /ceph/src/ceph_volume目录 生成 | ceph-volume为Python模块 | 构建时将该模块忽略 |
ceph-base | /usr/bin/ceph-detect-init | python脚本 | /ceph/src/ceph_detect-init目录 | ceph_detect-init为python模块 | spec文件中去除make ceph-detect-init且修改相关cmakelistfile |
/usr/sbin/ceph-disk | python脚本 | /ceph/src/ceph_disk目录 | ceph_disk为python模块 | spec文件中去除make ceph-disk且修改相关cmakelistfile | |
/usr/sbin/ceph-create-keys | python脚本 | /ceph/src/ceph-create-keys文件 | 脚本文件 | spec文件中%file过程中不安装该文件 | |
ceph-common | /usr/bin/ceph | python脚本 | /ceph/ceph.in文件生成 | 脚本文件 | spec文件中%file过程中不安装该文件 |
/usr/bin/ceph-brag | python脚本 | /ceph/src/brag | python模块 | 不安装该模块 |
4、设置ceph各服务的rpath及PYTHONHOME
4.1、RPATH设置,ceph服务添加RPATH(/usr/lib64/ceph)
服务 | |
ceph-common |
|
radosgw |
|
4.2、动态库收集,缺失会导致各服务运行时报错,libxxxx.so is not found!
架构 | 动态库 | 架构 | 动态库 |
x86_64 | /usr/lib64/ceph/ld-linux-x86-64.so.2 /usr/lib64/ceph/libcrypto.so.10 /usr/lib64/ceph/libcrypto.so.1.0.2k /usr/lib64/ceph/libc.so.6 /usr/lib64/ceph/libdb-5.3.so /usr/lib64/ceph/libdbus-glib-1.so.2 /usr/lib64/ceph/libgdbm.so.4 /usr/lib64/ceph/liblber-2.4.so.2 /usr/lib64/ceph/liblber-2.4.so.2.10.7 /usr/lib64/ceph/libldap-2.4.so.2 /usr/lib64/ceph/libldap-2.4.so.2.10.7 /usr/lib64/ceph/libleveldb.so.1 /usr/lib64/ceph/liblua-5.1.so /usr/lib64/ceph/liblzma.so.5 /usr/lib64/ceph/libnsl.so.1 /usr/lib64/ceph/libpanelw.so.5 /usr/lib64/ceph/libpython2.7.so.1.0 /usr/lib64/ceph/librpmbuild.so.3 /usr/lib64/ceph/librpmio.so.3 /usr/lib64/ceph/librpmsign.so.1 /usr/lib64/ceph/librpm.so.3 /usr/lib64/ceph/libssl.so.10 /usr/lib64/ceph/libssl.so.1.0.2k | aarch64 | /usr/lib64/ceph/ld-linux-aarch64.so.1 /usr/lib64/ceph/libbabeltrace-ctf.so.1 /usr/lib64/ceph/libbabeltrace.so.1 /usr/lib64/ceph/libcrypto.so.10 /usr/lib64/ceph/libcrypto.so.1.0.2k /usr/lib64/ceph/libc.so.6 /usr/lib64/ceph/libdb-5.3.so /usr/lib64/ceph/libdbus-glib-1.so.2 /usr/lib64/ceph/libgdbm.so.4 /usr/lib64/ceph/liblber-2.4.so.2 /usr/lib64/ceph/liblber-2.4.so.2.10.7 /usr/lib64/ceph/libldap-2.4.so.2 /usr/lib64/ceph/libldap-2.4.so.2.10.7 /usr/lib64/ceph/libleveldb.so.1 /usr/lib64/ceph/liblua-5.1.so /usr/lib64/ceph/liblzma.so.5 /usr/lib64/ceph/libnsl.so.1 /usr/lib64/ceph/libpanelw.so.5 /usr/lib64/ceph/libpython2.7.so.1.0 /usr/lib64/ceph/librpmbuild.so.3 /usr/lib64/ceph/librpmio.so.3 /usr/lib64/ceph/librpmsign.so.1 /usr/lib64/ceph/librpm.so.3 /usr/lib64/ceph/libssl.so.10 /usr/lib64/ceph/libssl.so.1.0.2k /usr/lib64/ceph/libtcmalloc.so.4 |
4.3、PYTHONHOME设置
因openeuler 22.03无法安装python2,故缺失/usr/lib64/python2.7目录,导致ceph-mgr运行所需要加载的python模块(如request等)无法找到,故修改PYTHONHOME及添加/usr/lib64/ceph/lib64/python2.7目录来保证ceph-mgr的正常运行
/usr/lib64/ceph/lib64/python2.7目录下存放ceph-mgr运行所需要的所有python模块