はじめに
業務でNFSサーバーを建てる機会があったので作成手順を残します。サーバー側、クライアン側ともにCentOS 7。
構成
# サーバー側
/var/nfs
# クライアント側
/mnt/nfs
SELinuxをオフ
$ vi /etc/selinux/config
SELINUX=enforcing
↓
SELINUX=disabled
$ reboot
サーバー側で行うこと
$ yum install -y nfs-utils
$ vi /etc/exports
/var/nfs 192.168.◯.◯/255.255.255.0(ro)
# 反映と確認
$ exportfs -ra
$ exportfs -v
# ファイアーウォールの設定
$ firewall-cmd --permanent --zone=public --add-service=nfs
$ firewall-cmd --reload
$ systemctl start rpcbind nfs-server
クライアント側で行うこと
$ yum install nfs-utils
$ mount -v -t nfs 192.168.◯.◯:/var/nfs /mnt/nfs
これでいけるはず。