最近在研究kubernetes,测试使用NFS作为k8s的文件系统。部署过程中的问题,归纳一下。

  • 报错‘clnt_create: RPC: Program not registered’,解决如下:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    # 请按顺序执行
    systemctl stop rpcbind
    systemctl stop nfs
    systemctl start rpcbind
    systemctl start nfs
    systemctl status rpcbind && systemctl status nfs

    #测试
    mount -t nfs 192.168.7.13:/datadir /mnt
  • 报错‘mount.nfs: access denied’,解决如下:
    1
    2
    3
    4
    5
    6
    7
    # 保证挂载client节点ip在server配置指定的网段内
    cat /etc/exports
    /dirdata 192.168.7.0/24(rw,no_root_squash,sync)
    # 如果指定的是192.168.7.0/24,那么client的ip也需要在这个网段内

    #测试
    mount -t nfs 192.168.7.13:/datadir /mnt

参考链接: