NFS服务配置:
服务端:
1.安装yum包
yum install -y nfs-utils
2.编辑配置文档
[root@a ~]# vim /etc/exports
写入:/home/nfstestdir 172.16.1.0/16(rw,sync,all_squash,anonuid=1000,anongid=1000)
3.启动:
[root@a ~]# mkdir /home/nfstestdir
[root@a ~]# systemctl start rpcbind
[root@a ~]# systemctl start nfs
[root@a ~]# systemctl enable rpcbind
[root@a ~]# systemctl enable nfs
Created symlink from /etc/systemd/system/multi-user.target.wants/nfs-server.service to /usr/lib/systemd/system/nfs-server.service.
客户端:
安装yum包:
yum install -yum nfs-utils
[root@a yum.repos.d]# showmount -e 172.16.1.196
Export list for 172.16.1.196:
/home/nfstestdir 172.16.1.0/16
挂载:
[root@a ~]# mount -t nfs 172.16.1.196:/home/nfstestdir /mnt/
[root@a ~]# df -h