1.服務器端安裝
yum -y install nfs-utils rpcbind
2.服務器端配置
nfs的端口爲2049
啓動NFS只需啓動portmap和NFS服務即可,Portmap的端口爲111
RPC所管理的所有NFS功能服務都需重新向RPC註冊
vi /etc/exports
/mnt/san 192.168.100.0/255.255.255.0(rw,async,no_subtree_check,no_root_squash)
rpcinfo -p|grep 111
rpcinfo -p|grep 2049
如果修改/etc/exports文件之後無需重啓nfs,只需重新掃瞄一次文件/etc/exports,並且重新將設定加載即可
exportfs –arv
3.啓動服務
/etc/init.d/rpcbind start
/etc/rc.d/init.d/nfs restart
4.客戶端配置
vi /etc/fstab
開機掛載
192.168.100.22:/mnt/san /data nfs rw,async,hard,intr,noatime,rsize=32768,wsize=32768 0 0
手動:
mount -t nfs -o rw,async,hard,intr,noatime,rsize=32768,wsize=32768 192.168.1.146:/mnt/disk2 /data
nfs 客戶端
showmount:在客戶端查看NFS服務器共享出來的目錄資源
還要一篇博文比較詳細,不過還沒實踐,大家可以嘗試一下: