0%

CentOS 7 安装NFS

1、安装NFS

1
yum install nfs-utils rpcbind -y

2、启动服务

1
2
3
4
systemctl start rpcbind.service
systemctl enable rpcbind.service
systemctl start nfs.service
systemctl enable nfs.service

3、配置nfs

1
2
3
4
[root@server01 ~]# cat /etc/exports

/data/mnt/mov/ 10.104.0.0/16(rw,no_root_squash,no_all_squash,sync,anonuid=501,anongid=501)
/data/application/file-police-tempFilePath/ 10.104.0.0/16(rw,no_root_squash,no_all_squash,sync,anonuid=501,anongid=501)

4、加载nfs配置

1
exportfs -rv

5、测试

1
2
3
4
5
nfs服务器挂载情况
showmount -e
挂载测试
mount -t nfs 10.104.38.28:/data/mnt/mov /data/mnt/mov
mount -t nfs 10.104.38.28:/data/application/file-police-tempFilePath /data/application/file-police-tempFilePath

6、查看客户端连接nfs情况

1
netstat -tan | awk -F'[ :]+' '$5==2049{print $6}'|egrep -v "0.0.0.0"