NFS

■必要なもの
portmap
nfslock
nfs
■確認
# chkconfig --list portmap
portmap 0:off 1:off 2:off 3:on 4:on 5:on 6:off
# chkconfig --list nfslock
nfslock 0:off 1:off 2:off 3:on 4:on 5:on 6:off
# chkconfig --list nfs
nfs 0:off 1:off 2:off 3:on 4:on 5:on 6:off
■install
# yum install nfs-utils.x86_64
■起動
/etc/init.d/rpcbind start
/etc/init.d/nfslock start
/etc/init.d/nfs start
※portmap=rpc.portmap=portmapper=rpcbind
■確認
# rpcinfo -p
自動起動設定
# chkconfig portmap on
# chkconfig nfslock on
# chkconfig nfs on
■設定ファイル
vi /etc/exports
/home/nfs 192.168.1.0/255.255.255.0(sync,rw,no_root_squash)
反映
# exportfs -a
確認
# exportfs -v
■ポート固定
/etc/sysconfig/nfs


■■クライアント側
■マウントポイント作成
# mkdir -p /mnt/nfs
■マウント
# mount -t nfs 192.168.1.11:/home/nfs /mnt/nfs




・ファイルがロックされていると待ち時間が発生する

session_start
flock

・nfslockデーモン
・ロックしない
# mount -o nolock /path/to/nfsdir
・ポート固定
/etc/sysconfig/nfs
・ポート確認
# rpcinfo -p localhost