エラー&対策をマウントについて調べながら。
##/etc/fstab設定
fstabにデバイス名、マウントポイント、ファイルシステム、オプションを設定
vi /etc/fstab
server1:/hoge /hoge nfs rw,hard,intr 0 0
・fstabの設定
http://unixlife.jp/linux/system/fstab.html
##mountコマンド
fstabに記述したマウントを設定。が、エラー。。
[hoge@hoge]$ mount -a
mount.nfs: rpc.statd is not running but is required for remote locking.
mount.nfs: Either use '-o nolock' to keep locks local, or start statd.
mount.nfs: an incorrect mount option was specified
mount.nfs: rpc.statd is not running but is required for remote locking.
rpc.statd が動いてない、リモートをロックするために必要。
mount.nfs: Either use '-o nolock' to keep locks local, or start statd.
ローカルロックを保つために'-o nolock'を使うか、statdを開始して。
mount.nfs: an incorrect mount option was specified
誤ったマウントオプションが指定された。
・mount ファイルシステムをマウントする
http://codezine.jp/unixdic/w/mount
##調査
####■rpc
Remote Procedure Call の略称
ネットワークによって接続された他のコンピュータ上でプログラムを呼び出し、実行させるための手法のことである。
http://www.sophia-it.com/content/%E3%83%AA%E3%83%A2%E3%83%BC%E3%83%88%E3%83%97%E3%83%AD%E3%82%B7%E3%83%BC%E3%82%B8%E3%83%A3%E3%82%B3%E3%83%BC%E3%83%AB
####■statd
NFS 上でロック・サービスのためのクラッシュ機能およびリカバリー機能を提供します。
・statd デーモン
http://publib.boulder.ibm.com/infocenter/aix/v7r1/index.jsp?topic=%2Fcom.ibm.aix.cmds%2Fdoc%2Faixcmds5%2Fstatd.htm
####■'-o nolock'
マウント時にロックをしない。
→リモートをロックしない?固定しない?
・ファイルサーバの構築(nfs)
参考項目:マウント時のエラーについて
http://kajuhome.com/nfs.shtml
####rpcプロセスが動いてない予感!
と思ったら書いてあった。
クライアント側でポートマッピングサービス「portmap」または「rpcbind」を起動する必要があります。
ということで、起動。
[hoge@hoge]$ service rpcbind status
rpcbind は停止しています
[hoge@hoge]$ service rpcbind start
rpcbind を起動中:
##/etc/exports
server1 の/etc/exports が設定していないのに気がつく。
vi /etc/exports
/hoge hoge_server_ip/255.255.255.255(rw,async)
共有するディレクトリと、そのアクセス許可を設定。
##再度マウント!
[hoge@hoge]$ mount -a
mount.nfs: requested NFS version or transport protocol is not supported
requested NFS version or transport protocol is not supported
要求されたNFSバージョンやトランスポートプロトコルがサポートされてない。
明示的に指定してやる必要がありそう。
[hoge@hoge]$ mount -t nfs -o proto=tcp,rw,hard,intr server1:/hoge /hoge
できた!
mountproto=tcp じゃなくて proto=tcp にするのがハマる。
・NFSを使用した、ボリュームの手動マウント
http://dai_yamashita.bitbucket.org/glusterfs_ja/Manually_Mounting_Volumes_Using_NFS.html
[hoge@hoge]$ df -h
確認して完了!
##その他参考
・NFSトラブルシュート
http://extstrg.asabiya.net/pukiwiki/index.php?NFS%A5%C8%A5%E9%A5%D6%A5%EB%A5%B7%A5%E5%A1%BC%A5%C8