NFS是Network File System的簡寫,網絡文件系統.通過使用NFS,用戶和程序可以像訪問本地文件一樣訪問遠端系統上的文件,根據權限的控制可以對NFS服務端的文件/目錄進行讀,寫,執行,刪除,增加,修改等。NFS至少有兩個主要部分:一個服務端和一個客戶端。客戶機遠程訪問存放在服務器上的數據。為了正常工作,一些進程需要被配置并運行。
目的:共享服務器端/home/share文件夾客戶端到/home/shareMe
服務器端(192.168.1.1):mkdir /home/sharefile /etc/exports //查看是否有export文件vi /etc/exportsvi內容:
/home/share 192.168.1.2(rw,async,all_squash,anonuid=0,anongid=0)注釋:此處是客戶端地址exportfs -v //查看服務狀態如果沒有開啟服務 執行此service nfs start // 使生效..Starting NFS XXX..Starting NFS XXX..Starting NFS XXX..Starting NFS XXX如果已經開啟了,exportfs -rv
然后exportfs -v //查看輸出,已經生效
設置服務端自啟動NFS服務chkconfig --list nfschkconfig nfs onchkconfig --list nfs //有區別
客戶端(192.168.1.2):掛載采集節點的目錄mkdir /home/shareMemount -o rw -t nfs 192.168.1.1:/home/share /home/shareMe
檢查mount是否成功、都mount了哪些/具體的mount選項mount
設置客戶端自啟掛載vi /etc/fstabvi內容:
192.168.1.1:/home/share /home/shareMe nfs user,rw,exec 0 0mount -a //使生效相關鏈接:http://blog.sina.com.cn/s/blog_6de3aa8a0101hlrj.htmlhttp://codingstandards.CUOxin.com/blog/816246http://codingstandards.CUOxin.com/blog/816246http://tutu.spaces.eepw.com.cn/articles/article/item/70737解決umount 時出現的 "Device is busy"http://tutu.spaces.eepw.com.cn/articles/article/item/70737http://www.360doc.com/content/13/0608/14/12600778_291501907.shtml/etc/fstab 參數詳解及如何設置開機自動掛載
新聞熱點
疑難解答