图集1/1

正文 909字数 43,998阅读


安装NFS服务
yum -y install rpcbind nfs-utils
Run code
Cut to clipboard


    创建共享目录并且设置相应的权限
    编辑配置文件
    vim /etc/exports
    Run code
    Cut to clipboard

      /data/share/ 192.168.0.101(rw,no_root_squash,no_all_squash,sync) /home/data/ 192.168.0.0/24(rw,no_root_squash,no_all_squash,sync) #允许局域网内所有的客户端访问 #NFS客户端挂载nfs服务器共享目录时的报错及解决办法:mount.nfs: access denied by server while mounting /nfsfile 192.168.41.*(rw,sync,root_squash)
      Run code
      Cut to clipboard


        更新配置
        exportfs -r
        Run code
        Cut to clipboard


          启动服务

          1)按照顺序启动
          systemctl start rpcbind systemctl start nfs
          Run code
          Cut to clipboard


            2)加入开机启动项
            systemctl enable rpcbind systemctl enable nfs
            Run code
            Cut to clipboard


              关闭防火墙和关闭 SELINUX
              systemctl disable firewalld setenforce 0
              Run code
              Cut to clipboard


                启动后查看NF服务是否正常
                rpcinfo -p
                Run code
                Cut to clipboard