Navigation : Top/NFS/autofs

  • 追加された行はこの色です。
  • 削除された行はこの色です。
*内容 [#v04566f1]

-NFS関係の設定 

---------------------------

* サーバー・クライアント共通の設定 [#mc2a5238]
- portmapが動作していることを確認
 # rpcinfo -u localhost portmap

*サーバー側の設定 [#o3eedcf4]
- /etc/exportsを設定
+ /etc/exportsを設定
-- 最近のバージョンはsync/asyncを明示しないと警告が出るようになった。
 /home neworder(rw,sync) 
 /mnt/cdrom neworder(ro,sync)
- /etc/exportsを書き換えたらnfsdを再起動
+ /etc/exportsを書き換えたらnfsdを再起動
 /etc/rc.d/init.d/nfs restart
 exportfs -ar
- /etc/hosts.allowでマウントを許可する
+ /etc/hosts.allowでマウントを許可する
 portmap: XXX.XXX.XXX.XXX
** iptablesの設定 [#p3a81f30]
Vine 4.1の場合、iptablesでポートが塞がれているので設定する必要がある。
- /etc/sysconfig/nfsを新規に作成します。
 LOCKD_PORT=XXXX
 STATD_PORT=YYYY
 MOUNTD_PORT=ZZZZ
- /etc/sysconfig/iptablesの設定を変更
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp -m multiport --dports 111,XXXX,YYYY,ZZZZ -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp -m multiport --dports 111,XXXX,YYYY,ZZZZ -j ACCEPT
** パフォーマンスの改善 [#j8801e37]
普段は必要ないが,接続ノードが多かったり,転送量が多い場合に調整が必要な場合がある.
*** サーバーの起動プロセス数を増やす [#f44dd7c7]
+ /etc/sysconfig/nfsを編集
 # Number of nfs server processes to be started.
 # The default is 8. 
 RPCNFSDCOUNT=16
+ nfsdを再起動,nfsdの数を確認
 # service nfs restart
 # ps -ef | grep nfs
 root      3402     4  0 10:43 ?        00:00:00 [nfsd4]
 root      3403     1  0 10:43 ?        00:00:00 [nfsd]
 (中略)
 root      3405     1  0 10:43 ?        00:00:00 [nfsd
やみくもに増やせばいいというものではないらしい.


*** /etc/exportsの書式 [#p0d578b5]
- ()の中は,ro(read only) rw(read and write)
- クライアントのrootに書き込み権を渡したい場合は(no_root_squash)を付記


* クライアントの設定 [#zb72c384]
- ちゃんとexportされているのか確認
 showmount -e サーバー名

** autofsの設定 [#e5078a40]
 $ mkdir /mnt/auto

- /etc/auto.masterの編集 
+ /etc/auto.masterの編集 
 # Sample auto.master file # Format of this file: 
 # mountpoint map options # For details of the format look at autofs(8). 
 
 # mountpoint map options # For details of the format look at autofs(8).  
 /mnt/auto /etc/auto.misc rsize=8192, wsize=8192 --timeout 180 

/etc/auto.miscの編集 

+ /etc/auto.miscの編集 
 cdrom -fstype=iso9660,ro,user :/dev/cdrom 
 floppy -fstype=auto,rw :/dev/fd0 
 # 
 neworder neworder:/home



* うまく動作しなかったとき [#ic2cec54]

** サ−バ−側 [#od54bd94]
- /etc/exportsの内容を変更した場合
 exportfs -ar
- iptables等firewallを疑う
- /var/log/messageをチェック

** クライアント側 [#gb1d6661]
showmount -e [server name]
を実行し,確認.

*関連リンク [#k85f221d]
** NFS [#n1da8b60]
- http://yang.amp.i.kyoto-u.ac.jp/~yyama/Linux/NFS.html
- http://warp.syns.net/14/index.html
- http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/ja/ref-guide/s1-nfs-client-config.html
** NFSのパフォーマンス調整 [#cd556ddc]
- http://docs.sun.com/app/docs/doc/819-4168/6n6bc3jhd?l=ja&a=view