【サーバ側】
# dnf install nfs-utils
# dnf install nfs-utils
# vi /etc/idmapd.conf
# vi /etc/exports
/data/ 10.0.11.0/24(rw,sync,wdelay,root_squash,insecure)Domain = stage.world
/data/ 10.0.12.0/24(rw,sync,wdelay,root_squash,insecure)
/data/ 10.0.13.0/24(rw,sync,wdelay,root_squash,insecure)
/data/ 10.0.14.0/24(rw,sync,wdelay,root_squash,insecure)
※ all_squash 全てのユーザ権限を下げる。(root_squash, all_squash)
# exportfs -rav
【クライアント側】
# dnf install nfs-utils rpcbind
# showmount -e 10.0.18.201
# firewall-cmd --add-service=nfs
# firewall-cmd --add-service={nfs3,mountd,rpc-bind}
# firewall-cmd --runtime-to-permanent
# firewall-cmd --add-service={nfs3,mountd,rpc-bind}
# firewall-cmd --runtime-to-permanent
# systemctl start --now rpcbind nfs-server
# systemctl enable --now rpcbind nfs-server
# dnf install nfs-utils rpcbind
# showmount -e 10.0.18.201
# vi /etc/idmapd.conf
Domain = stage.world
# systemctl restart rpcbind
# systemctl enable rpcbind
※サーバ側の変更時も、クライアント側の再起動が必要
# vi /etc/fstab
192.168.210.101:/data/ /.data nfs rw,hard 0 0
10.0.18.201:/data /.data nfs rw,hard 0 0
cd /
mkdir /.data
ln -s /.data aws
※ mount できない場合、dmesgで確認。
-----------------------------------------------------------------------------------------------
# サーバ側の設定
# cat /etc/redhat-release
CentOS release 6.5(Final)
# yum -y install nfs-utils
# vi /etc/exports
/work/ 129.1.68.0/24(rw,sync,no_root_squash,no_all_squash)
# vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 2049 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 2049 -j ACCEPT
# service iptables restart
#service rpcbind restart
#service rpcidmapd restart
#service nfs restart
#service nfslock restart
#chkconfig rpcbind on
#chkconfig rpcidmapd on
#chkconfig nfs on
# service rpcbind status
# chkconfig --list
# service nfs status
# rpcinfo -p
# showmount -e 129.1.68.188
# service rpcbind restart
# chkconfig rpcbind on
# vi /etc/fstab
192.1.68.188:/work /work nfs4 default 0 0
# chkconfig netfs on
or
# mount -t nfs -o rw 129.1.68.188:/work /work
# サーバ側の設定
# cat /etc/redhat-release
CentOS release 6.5(Final)
# yum -y install nfs-utils
# vi /etc/exports
/work/ 129.1.68.0/24(rw,sync,no_root_squash,no_all_squash)
# vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 2049 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 2049 -j ACCEPT
# service iptables restart
#service rpcbind restart
#service rpcidmapd restart
#service nfs restart
#service nfslock restart
#chkconfig rpcbind on
#chkconfig rpcidmapd on
#chkconfig nfs on
# service rpcbind status
# chkconfig --list
# service nfs status
# rpcinfo -p
# exportfs -ra
# exportfs -v
#クライアント側の設定
# vi /etc/idmapd.conf
Domain = centos.casio.co.jp# service rpcbind restart
# chkconfig rpcbind on
# vi /etc/fstab
192.1.68.188:/work /work nfs4 default 0 0
# chkconfig netfs on
or
# mount -t nfs -o rw 129.1.68.188:/work /work