NFS共享

服务端

安装

1
2
3
4
yum -y install nfs*

rpm -qa |grep nfs
rpm -qa |grep rpcbind

设置目录

1
2
3
vi /etc/exports

/root/download 192.168.137.111(rw,no_root_squash,no_all_squash,sync)

设置端口

1
2
3
4
5
6
7
vi /etc/sysconfig/nfs

MOUNTD_PORT=4001
STATD_PORT=4002
LOCKD_TCPPORT=30001
LOCKD_UDPPORT=30002
RQUOTAD_PORT=1001

启动服务

1
2
3
4
5
6
7
8
9
systemctl start nfs
systemctl start rpcbind
systemctl enable nfs
systemctl enable rpcbind

systemctl disable rpcbind
systemctl stop rpcbind
systemctl stop rpcbind.socket
systemctl stop nfs

查看

1
showmount -e localhost

客户端

安装 & 启动

查看访问

1
showmount -e 192.168.137.110

挂载

1
mount -t nfs -o nolock 192.168.137.110:/root/download /root/download2

卸载

1
2
3
umount /root/download2

umount 192.168.137.110:/root/download

参考