NFS网络文件系统

1. 软件安装,NFS只需要安装两个软件,在通常情况下是作为系统(CentOS 7.2)默认软件安装的。

    【rpcbind】centos 下面RPC主程序,低版本叫portmap

【nfs-utils】NFS服务主程序,包括NFS的基本命令和监控程序

NFS网络文件系统

2. 启动并自启动服务:

         systemctl start rpcbind

         systemctl start nfs

         systemctl enable rpcbind

         systemctl enable nfs

NFS网络文件系统

3. 服务器配置

服务器IP: 192.168.3.230,编辑要共享的目录:

vi /etc/exports

NFS网络文件系统

编辑完之后更新服务器的服务:

exportfs -r

4. 客户端配置

查看nfs共享状态:

showmount -e nfs服务器ip地址

NFS网络文件系统

5. 挂载本地目录到nfs目录:

mount NFS服务器IP:共享目录 本地挂载点目录

NFS网络文件系统

NFS网络文件系统

开机自动挂载,写入到rc.local文件里