NFSの設定 http://www.server-world.info/query?os=CentOS_6&p=nfs http://www.ksknet.net/linux/nfs_1.html http://rfs.jp/server/security/selinux01.html http://www.jp.redhat.com/manual/Doc9/rhl-rg-ja-9/s1-nfs-server-config.html http://linux.kororo.jp/cont/server/nfs.php を参考 ・サーバ側 1.ストレージサーバの/etc/exportsを編集 /data xxx.xxx.xxx.xxx(rw) yyy.yyy.yyy.yyyy(ro) という感じ. (xxx.xxx.xxx.xxx,yyy.yyy.yyy.yyy:クライアントのIPアドレス) rwは読み書きを許可,roは書き込み禁止. $/sbin/service nfs reload or $exportfs -ra で/etc/exportsの変更が反映される 2.SELinux,ファイアーウォールの設定 $ vi /etc/selinux/config SELINUX=enforcing →SELINUX=disabled サーバを再起動で変更が反映される. $/etc/rc.d/init.d/iptables stop $chkconfig iptables off $chkconfig --list iptables 3.hosts.allow, hosts.denyの設定 $vi /etc/hosts.allow sshd:ALLに加えて portmap:xxx.xxx.xxx.xxx, yyy.yyy.yyy.yyy (xxx.xxx.xxx.xxx,yyy.yyy.yyy.yyy:クライアントのIPアドレス) を追加 /etc/hosts.deny は基本的に ALL:ALL ファイルを保存した段階で変更が反映される 4.各種サービスの設定 $yum -y install nfs-utils 開始 (CentOS6.xの場合) $/etc/rc.d/init.d/rpcbind start (CentOS5.xの場合) $/etc/init.d/portmap start $/etc/rc.d/init.d/rpcbind start $/etc/rc.d/init.d/nfslock start $/etc/rc.d/init.d/nfs start 起動時に開始するよう設定 (CentOS6.xの場合) $chkconfig rpcbind on (CentOS5.xの場合) $chkconfig portmap on $chkconfig nfslock on $chkconfig nfs on $/sbin/chkconfig nfs on ・クライアント側 1.SELinuxの設定 $ vi /etc/selinux/config SELINUX=enforcing →SELINUX=disabled サーバを再起動で変更が反映される. 2.hosts.allow, hosts.denyの設定 $vi /etc/hosts.allow sshd:ALLに加えて portmap:xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx:サーバのIPアドレス) を追加 /etc/hosts.deny は基本的に ALL:ALL ファイルを保存した段階で変更が反映される 3.各種サービスの設定 $yum -y install nfs-utils 開始 (CentOS6.xの場合) $/etc/rc.d/init.d/rpcbind start (CentOS5.xの場合) $/etc/init.d/portmap start $/etc/rc.d/init.d/rpcbind start$/etc/rc.d/init.d/nfslock start $/etc/rc.d/init.d/nfs start 起動時に開始するよう設定 (CentOS6.xの場合) $chkconfig rpcbind on (CentOS5.xの場合) $chkconfig portmap on $chkconfig nfslock on $chkconfig nfs on $/sbin/chkconfig nfs on 4.クライアント側で (クライアント側・サーバ側ともCentOS5.xの場合) $mount -t nfs xxx.xxx.xxx.xxx:/data /data (クライアント側がCentOS6.x・サーバ側がCentOS5.xの場合) $mount -t nfs -o nolock xxx.xxx.xxx.xxx:/data /data