AKAI TSUKI

System development or Technical something

use NFS on CentOS 7

environment

hostname ip node
cent7no12 172.16.10.212 nfs client
cent7no41 172.16.10.241 nfs server

setting for nfs-server

on cent7no41

# yum -y install nfs-utils

# vi /etc/idmapd.conf

Domain = cent7no41

# mkdir -p /home/nfs
# chmod a+w /home/nfs
# ls -ld /home/nfs
drwxrwxrwx 4 root root 123 May 10 01:12 /home/nfs
#
# vi /etc/exports
# cat /etc/exports
/home/nfs 172.16.10.0/24(rw)
#

start nfs-server

on cent7no41

# systemctl start rpcbind nfs-server 
# systemctl enable rpcbind nfs-server 

setting for nfs-client and mount

on cent7no12

# yum -y install nfs-utils
# mkdir -p /mnt/nfs
# mount -t nfs 172.16.10.241:/home/nfs /mnt/nfs
# nfsstat -m
/mnt/nfs from 172.16.10.241:/home/nfs
 Flags: rw,relatime,vers=4.1,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=172.16.10.212,local_lock=none,addr=172.16.10.241

# df -hT
Filesystem              Type      Size  Used Avail Use% Mounted on
/dev/mapper/cl-root     xfs        35G  1.6G   34G   5% /
devtmpfs                devtmpfs  1.9G     0  1.9G   0% /dev
tmpfs                   tmpfs     1.9G     0  1.9G   0% /dev/shm
tmpfs                   tmpfs     1.9G   17M  1.9G   1% /run
tmpfs                   tmpfs     1.9G     0  1.9G   0% /sys/fs/cgroup
/dev/sda1               xfs      1014M  182M  833M  18% /boot
tmpfs                   tmpfs     380M     0  380M   0% /run/user/0
172.16.10.241:/home/nfs nfs4       35G  3.3G   32G  10% /mnt/nfs
#