为什么我的应用程序无法访问或写入 PVC?

排查块存储应用程序的问题。

虚拟私有云 传统基础设施

将 PVC 安装到 pod 后,在访问或写入 PVC 时可能会遇到错误。

  1. 列出集群中的 pod 并查看 pod 的状态。
    oc get pods
    
  2. 找出应用程序无法访问或写入 PVC 的根本原因。
    oc describe pod <pod_name>
    
    oc logs <pod_name>
    
  3. 查看将 PVC 安装到 pod 时可能发生的常见错误。
块存储错误信息
症状或错误消息 描述 解决步骤
Pod 处于 ContainerCreatingCrashLoopBackOff 状态。 MountVolume.SetUp failed for volume ... read-only. IBM Cloud 基础架构后端遇到网络问题。 为了保护数据和避免数据损坏,IBM Cloud 自动断开了块存储器服务器的连接,以阻止对块存储器实例执行写操作。 请参阅块存储器:块存储器更改为只读
failed to mount the volume as "ext4", it already contains xfs. Mount error: mount failed: exit status 32 您希望挂载一个已使用 XFS 文件系统配置的现有块存储实例。 在创建 PV 和与其匹配的 PVC 时,您指定了 ext4,或者未指定文件系统。 在 PV 中指定的文件系统必须与块存储器实例中设置的文件系统相同。 请参阅块存储器:由于文件系统不正确,将现有块存储器安装到 pod 失败