环境:创建服务并使用PVC 验证

pod创建后提示

describe 查询pod信息提示

 【场景1】 mount.nfs: Connection refused 

怀疑是k8s-node2节点上没有启动nfs服务,检查

# systemctl start nfs && systemctl enable nfs

服务器启动完成后pod恢复正常

【场景2】mount.nfs: mounting 192.168.66.100:/nfs1 failed, reason given by server: No such file or directory

手工挂载尝试

原来是nfs共享文件/etc/exports 没有对新目录进行配置,用户可以把需要共享的文件系统直接编辑到/etc/exports文件中,这样当NFS服务器重新启动时系统就会自动读取/etc/exports 文件

# echo "/nfs1 *(rw,no_root_squash,no_all_squash,sync)" >> /etc/exports

# echo "/nfs2 *(rw,no_root_squash,no_all_squash,sync)" >> /etc/exports

# echo "/nfs3 *(rw,no_root_squash,no_all_squash,sync)" >> /etc/exports

 重启nfs服务

# systemctl restart nfs

再次手工挂载正常

 Pod运行正常

 

添加

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐