副主节点创建空间成功,但是挂载失败

环境:

k3s(v1.26.9+k3s1)+rancher(2.7.9)+longhorn(v1.5.1)

问题描述

当k3s的主节点创建空间时一切正常,副主节点创建空间成功,但是挂载资源提示失败。同样副主节点想挂载之前创建的空间也提示一样的错误

重现步骤

  1. 副节点创建空间并且挂载

预期结果

挂载成功

日志

日志

MountVolume.MountDevice failed for volume “pvc-969f4253-164c-4787-b7f7-1599b78dc576” : rpc error: code = Internal desc = mount failed: exit status 32 Mounting command: /usr/local/sbin/nsmounter Mounting arguments: mount -t nfs -o vers=4.1,noresvport,intr,hard 10.43.181.244:/pvc-969f4253-164c-4787-b7f7-1599b78dc576 /var/lib/kubelet/plugins/kubernetes.io/csi/driver.longhorn.io/4a1cd4a43c94fd64b400a5eb7d448cef189d3d2d1c25d8c2e0198f6ffdb761bf/globalmount Output: mount: /var/lib/kubelet/plugins/kubernetes.io/csi/driver.longhorn.io/4a1cd4a43c94fd64b400a5eb7d448cef189d3d2d1c25d8c2e0198f6ffdb761bf/globalmount: bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount. helper program.

Unable to attach or mount volumes: unmounted volumes=[data], unattached volumes=[kube-api-access-xvvnv data]: timed out waiting for the condition

k3s日志

sdb: add missing path
Jan 10 14:22:39 k3s-master multipathd[1288107]: sdb: failed to get udev uid: Invalid argument
Jan 10 14:22:39 k3s-master multipathd[1288107]: sdb: failed to get sysfs uid: Invalid argument
Jan 10 14:22:39 k3s-master multipathd[1288107]: sdb: failed to get sgio uid: No such file or directory
Jan 10 14:22:40 k3s-master multipathd[1288107]: sda: add missing path
Jan 10 14:22:40 k3s-master multipathd[1288107]: sda: failed to get udev uid: Invalid argument
Jan 10 14:22:40 k3s-master multipathd[1288107]: sda: failed to get sysfs uid: Invalid argument
Jan 10 14:22:40 k3s-master multipathd[1288107]: sda: failed to get sgio uid: No such file or directory
Jan 10 14:22:44 k3s-master multipathd[1288107]: sdb: add missing path
Jan 10 14:22:44 k3s-master multipathd[1288107]: sdb: failed to get udev uid: Invalid argument
Jan 10 14:22:44 k3s-master multipathd[1288107]: sdb: failed to get sysfs uid: Invalid argument
Jan 10 14:22:44 k3s-master multipathd[1288107]: sdb: failed to get sgio uid: No such file or directory

环境信息

  • Longhorn 版本:
  • 安装方法 (e.g. Rancher Catalog App/Helm/Kubectl): Rancher Catalog App
  • Kubernetes 发行版 (e.g. RKE/K3s/EKS/OpenShift) 和版本:v1.26.9+k3s1
    • 集群管理节点个数:2
    • 集群 worker 节点数:1
  • Node 配置
    • 操作系统类型和版本:ubuntu20.46
    • 每个节点的CPU:4
    • 每个节点的内存:8
    • 磁盘类型(e.g. SSD/NVMe):
    • 节点间网络带宽::
  • 底层基础设施 (e.g. on AWS/GCE, EKS/GKE, VMWare/KVM, Baremetal):VMWare
  • 集群中Longhorn卷的个数:3

附加上下文

之前k3s中有多路径报错,对多路径服务进行关闭,现在开启多路径并且按照这篇文章修改各个主节点,目前问题得到解决

1 个赞

后经复测,并没有解决问题。当时重启多路径服务后,在Depoyment中点击重新部署,竟然部署回到主节点导致成功。实际上并没有解决副主节点创建空间无法使用的问题

根据错误提示,发现主节点有安装nfs-common,但是副主节点没有,安装后解决问题。