解决 OpenEBS 报错 cStor Volume replica degraded 副本降级修复
排查 Kubernetes 存储类 OpenEBS PVC 报 Volume status: Degraded,cStor 副本 Pod 报 pool out of sync,分析 坏盘重建与 zfs 存储池状态。
问题现象
Kubernetes 集群中基于 OpenEBS cStor 的持久卷突然发出降级告警:
$ kubectl get cstorvolume -n openebs
NAME CAPACITY STATUS AGE
pvc-4a11-b820-4102-8f11-9281a0021c12 100Gi Degraded 42d
触发根因
- 存储池中某个底层的节点或块设备发生硬件 I/O 故障,导致一个 cStor Replica 陷入
Offline状态; - 节点维护重启后网络瞬断,造成副本数据块 LSN 落后于主控 target。
解决步骤
检查各个 cStor 副本 Pod 及 CRD 的健康明细
执行详细诊断:
kubectl get cstorvolumereplica -n openebs -l openebs.io/cstor-volume=pvc-4a11-b820-4102-8f11-9281a0021c12
定位离线副本并检查 underlying pool 状态
检查对应节点上的 cStor 存储池集群(CSPC):
kubectl describe cstorpoolcluster -n openebs
若是软故障重启,触发在线静默自愈重建
若节点已上线,OpenEBS 会自动触发 ZFS resilver 同步,通过 describe 查看 resilvering 进度:
kubectl get cvr -n openebs -o wide
验证确认
重构完成后核对状态:
kubectl get cstorvolume -n openebs
Volume 状态重新从 Degraded 回归至 Healthy,三副本强一致性闭环完成。


