记一次centos挂载ceph存储的坑
阅读原文时间:2021年09月29日阅读:1

起因

生产有两台服务器,准备用来跑工作流,执行的资源的是放在ceph存储集群中,第一步挂载ceph

执行命令:mount -t ceph xxx:xxx -o name=admin,secret=AQXXX

mount -t ceph xxx:xxx  -o name=admin,secret=AQXXX
异常mount: unknown filesystem type 'ceph'

意思是不认识的filesystem,因垂丝汀

原因定位和尝试解决

第一反应就是内核版本太低

查阅资料,传送门:https://docs.ceph.com/en/latest/start/os-recommendations/

看样子没有centos6(奇怪),操作系统内核版本要求linux-3.10.0,centos6.9默认内核版本2.6,不支持

安装ceph-fuse

配置ceph国内源(阿里源,清华源都试过)

[Ceph]
name=Ceph packages for $basearch
baseurl=http://mirrors.163.com/ceph/rpm-jewel/el7/$basearch
enabled=1
gpgcheck=0
type=rpm-md
gpgkey=https://mirrors.163.com/ceph/keys/release.asc
priority=1
[Ceph-noarch]
name=Ceph noarch packages
baseurl=http://mirrors.163.com/ceph/rpm-jewel/el7/noarch
enabled=1
gpgcheck=0
type=rpm-md
gpgkey=https://mirrors.163.com/ceph/keys/release.asc
priority=1
[ceph-source]
name=Ceph source packages
baseurl=http://mirrors.163.com/ceph/rpm-jewel/el7/SRPMS
enabled=1
gpgcheck=0
type=rpm-md
gpgkey=https://mirrors.163.com/ceph/keys/release.asc
priority=1

yum install ceph-fuse

错误:Package: 2:ceph-fuse-10.2.11-0.el7.x86_64 (Ceph)
          Requires: libstdc++.so.6(CXXABI_1.3.7)(64bit)
错误:Package: 2:ceph-fuse-10.2.11-0.el7.x86_64 (Ceph)
          Requires: libboost_thread-mt.so.1.53.0()(64bit)
错误:Package: 2:ceph-fuse-10.2.11-0.el7.x86_64 (Ceph)
          Requires: libstdc++.so.6(CXXABI_1.3.5)(64bit)
错误:Package: 2:ceph-fuse-10.2.11-0.el7.x86_64 (Ceph)
          Requires: libstdc++.so.6(GLIBCXX_3.4.19)(64bit)
错误:Package: 2:ceph-fuse-10.2.11-0.el7.x86_64 (Ceph)
          Requires: libboost_system-mt.so.1.53.0()(64bit)
错误:Package: 2:ceph-fuse-10.2.11-0.el7.x86_64 (Ceph)
          Requires: libc.so.6(GLIBC_2.16)(64bit)
错误:Package: 2:ceph-fuse-10.2.11-0.el7.x86_64 (Ceph)
          Requires: libboost_iostreams-mt.so.1.53.0()(64bit)
错误:Package: 2:ceph-fuse-10.2.11-0.el7.x86_64 (Ceph)
          Requires: libstdc++.so.6(GLIBCXX_3.4.14)(64bit)
错误:Package: 2:ceph-fuse-10.2.11-0.el7.x86_64 (Ceph)
          Requires: libstdc++.so.6(GLIBCXX_3.4.15)(64bit)
错误:Package: 2:ceph-fuse-10.2.11-0.el7.x86_64 (Ceph)
          Requires: libstdc++.so.6(GLIBCXX_3.4.18)(64bit)
错误:Package: 2:ceph-fuse-10.2.11-0.el7.x86_64 (Ceph)
          Requires: libfuse.so.2(FUSE_2.9)(64bit)

不能自动下载,天真如我,我居然去下载编译GCC高版本,one hour later 再次安装后又发现缺少很多低版本的依赖,ceph-fuse安装失败

升级centos内核我都是去https://elrepo.org 上找,之前 CentOS7 Docker容器无法ping通宿主机ip问题解决记录 里面我就是从这里捞的内核升级包, 于是打开https://elrepo.org/linux/kernel/el6/x86_64/RPMS/,但是发现只有一个 elrepo-release-6-12.el6.elrepo.noarch.rpm

内核升级也是各种依赖找不到,资源下载不了,查了一下,centos6于2020年11月30日停止服务了,yum源能找到的基本都关了,ceph的网站也更新了,应当也是不建议centos6了,内核升级失败

PS:找了DC的小伙伴直接升级内核和操作系统版本也都以失败告终

数据和服务备份数据盘,重装系统,安装centos7.5,别人推荐版本,centos7服务到期2024年,还能折腾几年,貌似centos8 2021年底就停止维护了,以后不会再有免费的REDHAT用了,到时如果有需要直接换Ubuntu

装完直接挂载成功,异常丝滑

参考链接

https://www.jianshu.com/p/cedbdf0b6bca

https://blog.csdn.net/llggheshang/article/details/107425047

https://docs.ceph.com/en/latest/start/os-recommendations/