安装nfs的配件前端
yum -y install nfs-utils rpcbind
复制代码
编写配置文件安全
vi /etc/exports
/opt/test/ *(rw,no_root_squash,no_all_squash,sync,anonuid=506,anongid=506)
exportfs -r
复制代码
配置文件说明bash
启动服务网络
systemctl start rpcbind
systemctl start nfs
chkconfig rpcbind on
chkconfig nfs on
复制代码
安装async
yum -y install nfs-utils
复制代码
mount挂载使用:tcp
mount -t nfs 10.10.90.1:/opt/test /mnt -o nolock
复制代码
若是挂载出错能够使用以下方式:测试
mount -t nfs 10.10.90.1:/opt/test /mnt -o proto=tcp -o nolock
复制代码
在NFS客户端上执行如下命令,将本机的IP地址信息输出到NFS目录下的test.txt文件中:ui
ip addr > /mnt/test.txt
复制代码
在服务端中能够看到/opt/test/text.txt文件已经被建立。spa
umount /mnt
复制代码