<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Share | Hessian's Blog</title><link>https://hessian.cn/tag/share</link><description>Hessian 的技术笔记：Linux、C++、网络与嵌入式</description><language>zh-CN</language><atom:link href="https://hessian.cn/tag/share/index.xml" rel="self" type="application/rss+xml"/><item><title>CentOS Linux 6 NFS 配置</title><link>https://hessian.cn/p/1360.html</link><pubDate>Tue, 17 Sep 2013 20:34:40 +0800</pubDate><guid>https://hessian.cn/p/1360.html</guid><description>yum install nfs nfs-utils rpcbind&#13;service rpcbind start&#13;chckonfig rpcbind on&#13;cat "/shared_dir 192.168.1.200(rw,async,all_squash,anonuid=500,anongid=500)" &gt; /etc/exports 參數 參數功能 預設參數 fg&#10;bg 當執行掛載時，該掛載的行為會在前景 (fg) 還是在背景 (bg) 執行？ 若在前景執行時，則 mount 會持續嘗試掛載，直到成功或 time out 為止，若為背景執行， 則 mount 會在背景持續多次進行 mount ，而不會影響到前景的程序操作。 如果你的網路連線有點不穩定，或是伺服器常常需要開關機，那建議使用 bg 比較妥當。 fg soft&#10;hard 如果是 hard 的情況，則當兩者之間有任何一部主機離線，則 RPC 會持續的呼叫，直到對方恢復連線為止。如果是 soft 的話，那 RPC 會在 time out 後『重複』呼叫，而非『持續』呼叫， 因此系統的延遲會比較不這麼明顯。同上，如果你的伺服器可能開開關關，建議用 soft 喔！ hard intr 當你使用上頭提到的 hard 方式掛載時，若加上 intr 這個參數， 則當 RPC 持續呼叫中，該次的呼叫是可以被中斷的 (interrupted)。 沒有 rsize&#10;wsize 讀出(rsize)與寫入(wsize)的區塊大小 (block size)。 這個設定值可以影響用戶端與伺服器端傳輸資料的緩衝記憶容量。一般來說， 如果在區域網路內 (LAN) ，並且用戶端與伺服器端都具有足夠的記憶體，那這個值可以設定大一點， 比如說 32768 (bytes) 等，提升緩衝記憶區塊將可提升 NFS 檔案系統的傳輸能力！ 但要注意設定的值也不要太大，最好是達到網路能夠傳輸的最大值為限。 rsize=1024&#10;wsize=1024 mount -t nfs -o bg,soft,rsize=32768,wsize=32768 192.168.1.100:/shared_dir /mount_point Mac系统下挂载NFS有一点特别，需要加几个参数&#10;不加resvport在mac下会挂载不了，不加nolockd的话给文件加锁的时候会提示nfs server lockd not responding&#10;</description></item></channel></rss>