问题场景:
在没网的虚拟机里添加一些python库
在离线配置ceph集群时,发现缺少很多python的库,由于没有网,需要手动解决版本之间的兼容,记录一下解决的兼容问题
环境:
Python 2.7.5
CentOS-7-x86_64-DVD-2009.iso
均为官方初始状态
[root@ceph-node1 package_offline]# cd
[root@ceph-node1 ~]# python
Python 2.7.5 (default, Oct 14 2020, 14:45:30)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
问题描述
可以发现缺少
python-six
python-setuptools
python-markupsafe
python-prettytable
python-requests
这几个依赖
[ceph-node1][WARNIN] Error: Package: libstoragemgmt-python-1.8.1-2.el7_9.noarch (ceph)
[ceph-node1][DEBUG ] You could try using --skip-broken to work around the problem
[ceph-node1][WARNIN] Requires: python-six
[ceph-node1][WARNIN] Error: Package: python-paste-1.7.5.1-9.20111221hg1498.el7.noarch (ceph)
[ceph-node1][WARNIN] Requires: python-setuptools
[ceph-node1][WARNIN] Error: Package: python-mako-0.8.1-2.el7.noarch (ceph)
[ceph-node1][WARNIN] Requires: python-markupsafe
[ceph-node1][WARNIN] Error: Package: python2-six-1.9.0-0.el7.noarch (ceph)
[ceph-node1][WARNIN] Requires: python-six >= 1.9.0
[ceph-node1][WARNIN] Error: Package: python-pecan-0.4.5-2.el7.noarch (ceph)
[ceph-node1][WARNIN] Requires: python-setuptools
[ceph-node1][WARNIN] Error: Package: 2:ceph-mgr-14.2.22-0.el7.x86_64 (ceph)
[ceph-node1][WARNIN] Requires: python-requests
[ceph-node1][WARNIN] Error: Package: 2:ceph-mgr-14.2.22-0.el7.x86_64 (ceph)
[ceph-node1][WARNIN] Requires: python-six
[ceph-node1][WARNIN] Error: Package: python-singledispatch-3.4.0.2-2.el7.noarch (ceph)
[ceph-node1][WARNIN] Requires: python-six
[ceph-node1][WARNIN] Error: Package: 2:ceph-common-14.2.22-0.el7.x86_64 (ceph)
[ceph-node1][WARNIN] Requires: python-prettytable
[ceph-node1][WARNIN] Error: Package: 2:ceph-base-14.2.22-0.el7.x86_64 (ceph)
[ceph-node1][WARNIN] Requires: python-setuptools
[ceph-node1][DEBUG ] You could try running: rpm -Va --nofiles --nodigest
[ceph-node1][ERROR ] RuntimeError: command returned non-zero exit status: 1
[ceph_deploy][ERROR ] RuntimeError: Failed to execute command: yum -y install ceph ceph-radosgw
逐步解决:
1,上传包
打包好的包在文章顶部
或者点这里下载:下载链接
[root@ceph-node1 ~]# ls
anaconda-ks.cfg ceph-14.2.22.tar.gz package_offline.tar.gz
[root@ceph-node1 ~]#
2,逐级安装依赖
每一层文件夹都先安装setup里的依赖,再退回来安装,直至全部安装
[root@ceph-node1 ~]# tar -zxvf package_offline.tar.gz
[root@ceph-node1 ~]# cd package_offline
[root@ceph-node1 package_offline]# ll
total 564
-rwxr-xr-x. 1 root root 25792 Feb 4 21:30 python-markupsafe-0.11-10.el7.x86_64.rpm
-rwxr-xr-x. 1 root root 38000 Feb 4 21:27 python-prettytable-0.7.2-3.el7.noarch.rpm
-rwxr-xr-x. 1 root root 96872 Feb 4 22:01 python-requests-2.6.0-10.el7.noarch.rpm
-rwxr-xr-x. 1 root root 406404 Feb 4 21:39 python-setuptools-0.9.8-7.el7.noarch.rpm
drwxr-xr-x. 3 root root 181 Feb 5 19:07 setup
-rwxr-xr-x. 1 root root 0 Feb 5 10:14 每层目录都先安装setup里的.txt
[root@ceph-node1 package_offline]# cd setup/
[root@ceph-node1 setup]# ll
total 156
-rwxr-xr-x. 1 root root 12896 Feb 4 21:40 python-backports-ssl_match_hostname-3.5.0.1-1.el7.noarch.rpm
-rwxr-xr-x. 1 root root 35176 Feb 4 21:43 python-ipaddress-1.0.16-2.el7.noarch.rpm
-rwxr-xr-x. 1 root root 105188 Feb 4 22:07 python-urllib3-1.10.2-7.el7.noarch.rpm
drwxr-xr-x. 2 root root 137 Feb 5 10:59 setup
[root@ceph-node1 setup]# cd setup/
[root@ceph-node1 setup]# ll
total 268
-rwxr-xr-x. 1 root root 5932 Feb 4 21:42 python-backports-1.0-8.el7.x86_64.rpm
-rwxr-xr-x. 1 root root 232448 Feb 4 22:06 python-chardet-2.2.1-3.el7.noarch.rpm
-rwxr-xr-x. 1 root root 29404 Feb 4 21:33 python-six-1.9.0-2.el7.noarch.rpm
[root@ceph-node1 setup]# yum install -y ./*
......
Installed:
python-backports.x86_64 0:1.0-8.el7 python-chardet.noarch 0:2.2.1-3.el7 python-six.noarch 0:1.9.0-2.el7
Complete!
[root@ceph-node1 setup]# cd ../
[root@ceph-node1 setup]# yum install -y ./*
......
Installed:
python-backports-ssl_match_hostname.noarch 0:3.5.0.1-1.el7 python-ipaddress.noarch 0:1.0.16-2.el7 python-urllib3.noarch 0:1.10.2-7.el7
Complete!
[root@ceph-node1 setup]# cd ../
[root@ceph-node1 package_offline]# yum install -y ./*
......
Installed:
python-markupsafe.x86_64 0:0.11-10.el7 python-prettytable.noarch 0:0.7.2-3.el7 python-requests.noarch 0:2.6.0-10.el7 python-setuptools.noarch 0:0.9.8-7.el7
Complete!
[root@ceph-node1 package_offline]#
至此完全解决初始状态下的Centos/Python2.7.5部署ceph集群缺少依赖的问题