cetnos7下部分命令已變,例如ifconfig變更爲ip addr
使用yum安裝nfs
yum -y install nfs-unitls rpcbind
修改配置文檔/etc/exports
初開始文檔裏沒有任何內容,可以自行添加:
/opt/test/ 192.168.1.0/24(rw,no_root_squash,no_all_squash,sync)
使配置生效
exportfs -r
查看是否安裝了nfs
rpm -qa | grep nfs rpcbind
啓動nfs
service rpcbind start或者使用/bin/systemctl start rpcbind.service
service nfs start或者使用/bin/systemctl start nfs.service
chkconfig rpcbind on或者使用systemctl enable rpcbind.service
chkconfig nfs on或者使用systemctl enable nfs.service
查看掛載
showmount -e
客戶端掛載
mount -t nfs 192.168.1.*:/opt/test /mnt