当前位置:首页 > 操作系统 > Linux

linux--nfs服务器

     NFS,是Network File System的简写,即 网络文件系统 。网络文件系统是FreeBSD支持的文件系统中的一种,也被称为NFS. NFS允许一个系统在网络上与他人共享目录和文件。通过使用NFS,用户和程序可以像访问本地文件一样访问远端系统上的文件.
 
    
    1.  rpm -qa|grep nfs        rpm -qa|grep rpcbind   检查Linux上是否已安装 nfs 和 rpcbind 软件。若没有,安装即可。
      650) this.width=650;" src="/upload/getfiles/default/2022/11/15/20221115045201854.jpg" />
      650) this.width=650;" src="/upload/getfiles/default/2022/11/15/20221115045202028.jpg" />
     2.  service nfs start          service rpcbind start   开启nfs  和  rpcbind 服务。
     650) this.width=650;" src="/upload/getfiles/default/2022/11/15/20221115045202200.jpg" />
     650) this.width=650;" src="/upload/getfiles/default/2022/11/15/20221115045202291.jpg" />

     3. mkdir /share             chmod   777   /share         创建和修改一个目录权限,来设置服务器的共享目录。
     650) this.width=650;" src="/upload/getfiles/default/2022/11/15/20221115045202396.jpg" />
    4. vim /etc/exports       修改配置文件。
     650) this.width=650;" src="/upload/getfiles/default/2022/11/15/20221115045202539.jpg" />
    5. 按下图修改。    (红字是注释
     650) this.width=650;" src="/upload/getfiles/default/2022/11/15/20221115045202719.jpg" />
  
    6 . exportfs -av   使配置文件生效
      650) this.width=650;" src="/upload/getfiles/default/2022/11/15/20221115045202820.jpg" />
    7.service nfs restart  重启NFS服务
     650) this.width=650;" src="/upload/getfiles/default/2022/11/15/20221115045202940.jpg" />
  
    8.showmount -e 172.16.109.86   (-e 后是IP) 查看NFS服务上共享的目录。(最好在其他linux上测试
    650) this.width=650;" src="/upload/getfiles/default/2022/11/15/20221115045203018.jpg" />
    
    9.showmount -t nfs 172.16.109.86:/share  把共享目录挂载到本地linux上。
    650) this.width=650;" src="/upload/getfiles/default/2022/11/15/20221115045203114.jpg" />
    10.vim /etc/fstab    设置自动挂载。(如下图)
     650) this.width=650;" src="/upload/getfiles/default/2022/11/15/20221115045203234.jpg" />
   
   11.大功告成。
    


本文出自 “心远,路远。” 博客,请务必保留此出处http://yzh123.blog.51cto.com/9014017/1550427

原文:http://yzh123.blog.51cto.com/9014017/1550427


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!