標籤:linux nfs
Mark之
安裝:
yum -y install nfs-utils rpcbind
nfs伺服器配置:
/home/nfs 192.168.150.*(rw,sync,no_root_squash)
/home/nfs 本地路徑,可供其他使用者訪問的
192.168.150.* 此IP下連結的使用者才可以訪問
(rw,sync,no_root_squash) PS:此處和IP地址沒有空格
rw:讀寫權限
sync:檔案同時寫入硬碟和記憶體
no_root_squash:root使用者被壓縮為nfs server的root使用者
啟動服務:
service nfs start
如果出現如下錯誤:
Starting NFS services: [ OK ]
Starting NFS quotas: Cannot register service: RPC: Unable to receive; errno = Connection refused
rpc.rquotad: unable to register (RQUOTAPROG, RQUOTAVERS, udp).
[FAILED]
Starting NFS mountd: [FAILED]
Starting NFS daemon: rpc.nfsd: writing fd to kernel failed: errno 111 (Connection refused)
rpc.nfsd: unable to set any sockets for nfsd
[FAILED]
RH系作業系統在6.0版本之後沒有portmap服務控制rpc的啟動,由於NFS和nfslock的啟動需要向rpc進行註冊,rpc不啟動的話就會報錯。
解決方案:啟動rpcbind&rpcidmap rpcbind是6.0版本後預設的RPC服務,所以要先於nfs啟動。如果不啟動rpcidmap則會造成使用者權限的映射錯誤,使用者的許可權看起來是一串數字。
[[email protected] ~]# /etc/init.d/rpcbind start
Starting rpcbind: [ OK ]
[[email protected] ~]# /etc/init.d/rpcidmapd start
Starting RPC idmapd: [ OK ]
[[email protected] ~]# /etc/init.d/nfs start
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS mountd: [ OK ]
Starting NFS daemon: [ OK ]
引用自:http://www.linuxyw.com/a/yunweiguzhang/20130520/405.html
用戶端啟動:
/etc/init.d/rpcbind start
掛載
mount -t nfs 192.168.150.130:/home/nfs
非常簡單。
參考:http://www.it165.net/admin/html/201405/3177.html
linux nfs安裝記錄