最近想把一个现有的 Ceph 客户端升级为最新的 M 版:
[root@overcloud-ovscompute-0 ~]# rpm -qa | grep ceph
puppet-ceph-2.4.1-2.el7ost.noarch
libcephfs1-10.2.10-17.el7cp.x86_64
ceph-base-10.2.10-17.el7cp.x86_64
ceph-osd-10.2.10-17.el7cp.x86_64
python-cephfs-10.2.10-17.el7cp.x86_64
ceph-selinux-10.2.10-17.el7cp.x86_64
ceph-mon-10.2.10-17.el7cp.x86_64
ceph-common-10.2.10-17.el7cp.x86_64
ceph-radosgw-10.2.10-17.el7cp.x86_64
在更新了 Ceph YUM 源并执行 Upgrade 时,出现错误:
--> Finished Dependency Resolution
Error: Package: 2:ceph-selinux-13.2.5-0.el7.x86_64 (Ceph)
Requires: selinux-policy-base >= 3.13.1-229.el7_6.9
Installed: selinux-policy-targeted-3.13.1-229.el7_6.6.noarch (installed)
selinux-policy-base = 3.13.1-229.el7_6.6
Error: Package: 2:ceph-base-13.2.5-0.el7.x86_64 (Ceph)
Requires: gperftools-libs >= 2.6.1
Installed: gperftools-libs-2.4-8.el7.x86_64 (@rhos-10.0-ceph-2.0-mon-signed)
gperftools-libs = 2.4-8.el7
You could try using --skip-broken to work around the problem
显然是 selinux-policy-base 和 gperftools-libs 的版本依赖不足,解决这个问题的办法有两个:
这列我们主要使用第 2 个办法。
Step 1. 下载依赖版本的 RPM 包
[root@overcloud-ovscompute-0 fanguiju]# ll
-rw-r--r--. 1 root root 495060 Feb 2 00:26 selinux-policy-3.13.1-229.el7_6.9.noarch.rpm
-rw-r--r--. 1 root root 7246376 Apr 30 18:46 selinux-policy-targeted-3.13.1-229.el7_6.9.noarch.rpm
Step 2. 执行升级
[root@overcloud-ovscompute-0 fanguiju]# rpm -U selinux-policy-targeted-3.13.1-229.el7_6.9.noarch.rpm
warning: selinux-policy-targeted-3.13.1-229.el7_6.9.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
error: Failed dependencies:
selinux-policy = 3.13.1-229.el7_6.9 is needed by selinux-policy-targeted-3.13.1-229.el7_6.9.noarch
[root@overcloud-ovscompute-0 fanguiju]# rpm -U selinux-policy-3.13.1-229.el7_6.9.noarch.rpm
warning: selinux-policy-3.13.1-229.el7_6.9.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
error: Failed dependencies:
selinux-policy = 3.13.1-229.el7_6.6 is needed by (installed) selinux-policy-targeted-3.13.1-229.el7_6.6.noarch
麻烦在于升级 selinux-policy-targeted 首先要升级 selinux-policy,但升级 selinux-policy 又会被低版本的 selinux-policy-targeted 依赖。所以只能先卸载低版本的 selinux-policy-targeted:
yum remove selinux-policy-targeted
然后升级 selinux-policy:
rpm -Uvh selinux-policy-3.13.1-229.el7_6.9.noarch.rpm
最后再安装新版版的 selinux-policy-targeted:
rpm -ivh selinux-policy-targeted-3.13.1-229.el7_6.9.noarch.rpm
Step 3. 查看升级结果:
[root@overcloud-ovscompute-0 fanguiju]# rpm -qa | grep selinux-policy
selinux-policy-3.13.1-229.el7_6.9.noarch
selinux-policy-targeted-3.13.1-229.el7_6.9.noarch
同理在把 gperftools-libs 升级。
[root@overcloud-ovscompute-0 fanguiju]# rpm -qa | grep gperftools-libs
gperftools-libs-2.4-8.el7.x86_64
[root@overcloud-ovscompute-0 fanguiju]# rpm -qa | grep gperftools-libs
gperftools-libs-2.6.1-1.el7.x86_64
再次升级 Ceph。
================================================================================================================================================================================================================================================================================
Package Arch Version Repository Size
================================================================================================================================================================================================================================================================================
Installing:
libcephfs2 x86_64 2:13.2.5-0.el7 Ceph 434 k
replacing libcephfs1.x86_64 2:10.2.10-17.el7cp
Updating:
ceph-base x86_64 2:13.2.5-0.el7 Ceph 4.9 M
ceph-common x86_64 2:13.2.5-0.el7 Ceph 14 M
ceph-mon x86_64 2:13.2.5-0.el7 Ceph 3.9 M
ceph-osd x86_64 2:13.2.5-0.el7 Ceph 13 M
ceph-radosgw x86_64 2:13.2.5-0.el7 Ceph 4.5 M
ceph-selinux x86_64 2:13.2.5-0.el7 Ceph 21 k
python-cephfs x86_64 2:13.2.5-0.el7 Ceph 86 k
Installing for dependencies:
liboath x86_64 2.4.1-9.el7 epel 35 k
libradosstriper1 x86_64 2:13.2.5-0.el7 Ceph 329 k
python-rgw x86_64 2:13.2.5-0.el7 Ceph 75 k
Updating for dependencies:
librados2 x86_64 2:13.2.5-0.el7 Ceph 2.9 M
librbd1 x86_64 2:13.2.5-0.el7 Ceph 1.2 M
librgw2 x86_64 2:13.2.5-0.el7 Ceph 2.0 M
python-rados x86_64 2:13.2.5-0.el7 Ceph 189 k
python-rbd x86_64 2:13.2.5-0.el7 Ceph 132 k
[root@overcloud-ovscompute-0 ~]# ceph --version
ceph version 13.2.5 (cbff874f9007f1869bfd3821b7e33b2a6ffd4988) mimic (stable)
[root@overcloud-ovscompute-0 ~]# rpm -qa | grep ceph
ceph-selinux-13.2.5-0.el7.x86_64
puppet-ceph-2.4.1-2.el7ost.noarch
ceph-osd-13.2.5-0.el7.x86_64
python-cephfs-13.2.5-0.el7.x86_64
ceph-common-13.2.5-0.el7.x86_64
ceph-mon-13.2.5-0.el7.x86_64
libcephfs2-13.2.5-0.el7.x86_64
ceph-radosgw-13.2.5-0.el7.x86_64
ceph-base-13.2.5-0.el7.x86_64