源服务器:
1、安装yum -y install nfs-utils rpcbind;
2、编辑/etc/exports,增加一行 /要共享目录的路径 要挂在服务器的IP (rw);
说明括号里边还有别的参数,详细请自己去查阅
3、启动服务
systemctl start rpcbind
systemctl start nfs-server
添加开启启动服务
systemctl enable rpcbind
systemctl enable nfs-server
centos6的启动命令如下:
service rpcbind start
service nfslock start
service nfs start
chkconfig rpcbind on
chkconfig nfslock on
chkconfig nfs on
4、开启防火墙
用的111和2049端口
客户端:
1、安装客户端yum install -y nfs-utils
2、启动服务
3、创建挂载点
4、mount -t nfs 服务器端IP:/要共享目录的路径 /挂载点
5、添加开机自动挂载,编辑etc/fstab
服务器端IP:/要共享目录的路径 /挂载点 nfs defaults 0 0