解决 Longhorn 报错 Volume attachment failed: replica degraded 卷挂载卡死修复
排查 Kubernetes Pod 启动卡在 ContainerCreating,报 volume attachment failed 且 Longhorn 提示 replica degraded,分析磁盘状态与重建。
问题现象
Pod 无法拉起并持续报错:
Events:
Warning FailedAttachVolume AttachVolume.Attach failed for volume "pvc-1234": rpc error: code = Internal desc = volume pvc-1234 is not attached to node node-1
Longhorn 控制台显示该卷状态为 Degraded,其中一个副本处于 Error 状态。
触发根因
- 集群某个节点磁盘使用率达到了 Longhorn 设定的存储超分阈值,导致副本无法写入;
- 节点间数据同步时网络瞬断导致副本数据校验失步(Out-of-sync);
- 先前挂载的旧节点未正常解绑导致 Volume 处于 Attachment 竞态冲突。
解决步骤
在 Longhorn UI 中定位故障副本并触发重新构建
选择问题副本点击 Delete,Longhorn 将自动在其它满足条件的健康节点上自动拉起新副本并执行重建同步。
检查集群存储节点的可用空间与调度开关
确保宿主机保留至少 15% 可用物理空间以满足重建要求。
验证确认
Pod 秒级完成 Volume 挂载并转为 Running 状态,Longhorn 卷健康度恢复为 Healthy 绿色。


