安装步骤
1、安装命令
yum install nfs-utils rpcbind -y
2、设置开放文件并且开放权限
chmod 777 /home/share/
3、设置/etc/exports填写如下
vi /etc/exports
/home/share *(rw,sync,no_root_squash)
4、启动/重启/开启启动 nfs-server 和 rpcbind
service nfs-server start
service rpcbind start
service nfs-server restart
service rpcbind restart
systemctl enable nfs-server
systemctl enable rpcbind
客户端安装
1、安装命令 (Mac无需安装)
yum install nfs-utils
2、Centos挂盘命令
mount -t nfs,vers=3,local_lock=yes 192.168.1.253:/home/share /app
mount -t nfs -o nolock 192.168.1.253:/home/share /app
3、Mac挂载(无需安装客户端)
sudo mount -o resvport 192.168.1.253:/home/share/ /app
Centos开机启动
vim /etc/rc.d/rc.local
mount -t nfs -o nolock 192.168.1.253:/home/share /app
chmod +x /etc/rc.d/rc.local