Centos7 安装NFS+windows客户端配置

  1. 查看是否安装nfs

    # systemctl status rpcbind.service
    # systemctl status nfs-server.service
    
  2. 安装

    # yum install -y nfs-utils
    
  3. 编辑exports文件

    # vim /etc/exports
    添加
    /Disk/sharestore/ *(rw,sync,no_root_squash,anonuid=0,anongid=0)
    
  4. 启动nfs服务(必须先启动rpcbind服务)

    # systemctl enable rpcbind.service
    # systemctl enable nfs-server.service
    # systemctl start rpcbind.service
    # systemctl start nfs-server.service
    # rpcinfo -p
    检查 NFS 服务器是否挂载我们想共享的目录 /home/nfs/
    # exportfs -r
    使配置生效
    # exportfs
    可以查看到已经ok
    /Disk/sharestore
                    <world>
    
  5. 在从机上安装NFS 客户端

    1.安装nfs服务,同上
    2.启动rpcbind.service(客户端不需要启动nfs服务)
    
  6. 固定端口(重启服务不生效,需要重启服务器)

     vi /etc/sysconfig/nfs
     添加:
         RQUOTAD_PORT=3001
         MOUNTD_PORT=3002
         STATD_PORT=3003
     vi /etc/modrpobe.d/lockd.conf
     修改
         options lockd nlm_tcpport=3004
         options lockd nlm_udpport=3004
    
  7. 查看端口

    # rpcinfo -p
    
  8. 端口添加到防火墙并重启防火墙,添加端口分别为111,2049,3301-3304

  9. windows配置

    HKEY_LOCAL_MACHINESOFTWAREMicrosoftClientForNFSCurrentVersionDefault下

    右键——新建——QWORD(64位)值
    名称:AnonymousGid和AnonymousUid,数据默认就可以,重启电脑即可

原文地址:https://www.cnblogs.com/ucfjepl/p/13915780.html