#NFS server
#CentOS7
#端口开放
firewall-cmd --permanent --add-port=111/tcp
firewall-cmd --permanent --add-port=111/udp
firewall-cmd --permanent --add-port=2049/tcp
firewall-cmd --permanent --add-port=2049/udp
firewall-cmd --reload
yum install nfs-utils rpcbind
systemctl status rpcbind.service
systemctl restart rpcbind.service
systemctl status rpcbind.service
systemctl start nfs.service
systemctl status nfs.service
#设置开机自启
chkconfig rpcbind on
chkconfig nfs on
chkconfig --list rpcbind
chkconfig --list nfs
#配置挂载文件
vim /etc/exports
修改
{/home/master/nfs_test/} *(rw,sync,insecure,no_root_squash,no_subtree_check)
chown nfsnobody.nfsnobody {/home/seetacloud_files/}
exportfs -rv
showmount -e localhost
reboot #生效
以上完成server部署,接下来部署client 实现挂载
#NFS client
#Ubuntu 16.04
#安装客户端
apt install nfs-common
挂载
mount -t nfs {192.168.0.185:/home/master/nfs_test} {/home/master/nfs_test}