NFS版本4提供了NFSv3的或更早版本的NFS以下好處:
 
-效能改進,加強的權限管理
-完整Unicode支援
-任務的安全性和訪問控制列表
-捨棄RPC方式,大幅改進效能,NFS v4 工作在TCP 通信協定
-可使用加密傳輸,更適合跨網段使用
-易於安裝防火牆選項
 
需要安裝的套件
nfs-utils – The nfs-utils package provides a daemon for the kernel NFS server and related tools, which provides a much higher level of performance than the traditional Linux NFS server used by most users.
portmap – The portmap package should be installed on any machine which acts as a server for protocols using RPC.
nfs4-acl-tools – This package contains commandline and GUI ACL utilities for the Linux NFSv4 client.
 
先看Server端安裝 NFS V4 server
yum install nfs-utils nfs4-acl-tools portmap
修改 /etc/exports (server端把/sales 開NFS分享)
vi /etc/exports
/sales 192.168.1.15(rw,sync,no_root_squash,fsid=0) 192.168.1.16(rw,sync,no_root_squash,fsid=0)
 
重新啟動 nfs service
service nfs restart
service portmap restart
service nfslock restart
 
或者使用下方指令將設定做重新發怖,所以不必重新啟動 nfs service
exportfs -rv
 
chkconfig nfs on
chkconfig portmap on
先假設防火牆沒開,所以不用設定防火牆
 
接下來先看 Client端 如何安裝與設定
Client端也安裝NFS V4 server
yum install nfs-utils nfs4-acl-tools portmap
秀出 NFS Server 分享出那些
showmount -e serverIP
nfsstat –all
掛載(把/sales 掛在到 /home/nfs)
mount -t nfs4 serverIP:/ /home/nfs
如果是用下面這個指令,會一直出現mount.nfs4 failed, reason given by server: No such file or directory
mount -t nfs4 serverIP:/sales /home/nfs
ERIC9069

Tags: , , ,