首页
/ Rook Ceph集群中CephFS挂载失败的排查与解决方案

Rook Ceph集群中CephFS挂载失败的排查与解决方案

2025-05-18 07:06:04作者:蔡丛锟

问题背景

在使用Rook Ceph部署分布式存储系统时,用户遇到了CephFS卷无法挂载到Pod的问题。具体表现为Pod处于ContainerCreating状态,错误日志显示"unable to get monitor info from DNS SRV with service name: ceph-mon"。本文将深入分析这一问题,并提供多种解决方案。

环境配置

用户部署环境为:

  • Kubernetes集群:1个控制节点+3个工作节点,使用kubeadm部署
  • 操作系统:Ubuntu 18.04 LTS(内核版本4.15)
  • Rook版本:v1.15.4
  • Ceph版本:18.2.4 (Reef稳定版)
  • CNI插件:Cilium

问题现象

虽然Ceph集群状态显示为HEALTH_OK,所有相关Pod均正常运行,但在尝试挂载CephFS卷时出现以下错误:

unable to get monitor info from DNS SRV with service name: ceph-mon
2024-11-11T10:06:52.478+0000 7f2266ce0000 -1 failed for service _ceph-mon._tcp
mount error 95 = Operation not supported

根本原因分析

经过深入排查,发现该问题由多个因素共同导致:

  1. DNS SRV记录缺失:Ceph客户端默认会尝试通过DNS SRV记录查找名为"ceph-mon"的服务,但Rook默认创建的是"rook-ceph-mon-a"、"rook-ceph-mon-b"等格式的服务名称。

  2. 内核兼容性问题:Ubuntu 18.04使用的4.15内核对CephFS的msgr2协议支持不完善,特别是在使用较新版本的Ceph时。

  3. 网络配置问题:某些CNI插件(如Cilium)可能需要特殊配置才能正确处理Ceph的监控流量。

解决方案

方案一:创建ceph-mon服务(临时解决方案)

作为临时解决方案,可以手动创建一个名为"ceph-mon"的Service,复制rook-ceph-mon-a的配置:

apiVersion: v1
kind: Service
metadata:
  name: ceph-mon
  namespace: rook-ceph
spec:
  ports:
  - name: mon
    port: 6789
    protocol: TCP
    targetPort: 6789
  - name: msgr2
    port: 3300
    protocol: TCP
    targetPort: 3300
  selector:
    app: rook-ceph-mon
    mon: a
  type: ClusterIP

注意:此方案仅作为临时解决方案,因为:

  1. fsName: myfs pool: myfs-data0 c
登录后查看全文
热门项目推荐
相关项目推荐