[Installation on CentOS]

1. install packages
dnf(yum) install nfs-utils* nfs4-acl-tools portmap

2. Prepare Share File System
mkdir {desired location}
mount –bind …..

3. service on
systemctl enable nfs
systemctl enable portmap

systemctl start nfs
systemctl start portmap

4. open firewall (selinux port permission 도 확인 필요)
firewall-cmd –zone=publie –add-port=2049/tcp –permanent
firewall-cmd –reload

5. nfs permission
open /etc/exports

${root-path} ip-range(permissions) …
${child-path} ip-range(permissions) …

ex>
/srv/nfs4         172.17.19.0/24(rw,insecure,sync,no_subtree_check,crossmnt,fsid=0) 172.17.17.0/24(rw,insecure,sync,no_subtree_check,crossmnt,fsid=0) 172.17.31.0/24(rw,sync,no_subtree_check,crossmnt,fsid=0)
/srv/nfs4/shared  172.17.19.0/24(rw,insecure,sync,no_subtree_check) 172.17.17.0/24(rw,insecure,sync,no_subtree_check) 172.17.31.0/24(rw,insecure,sync,no_subtree_check)

rw: 읽기쓰기, ro: 읽기
insecure: 보안해제
sync: 동기화
no_subtree_check: 하위검색
crossmnt: mounted dir 접근 허용
fsid=0: root dir (하위 dir에서는 사용하지 않거나, 0 이외의 다른 id부여)

[Client]
1. install packages
dnf(yum) install nfs-utils*

2. mount
mount -t nfs -o vers=4 172.17.19.81:/shared /opt/shared/redmine-server
[-t nfs] => file system type
[vers=4] =>  Version4
[172.17.19.81:/shared] => ${server-address}:${dir}
[opt/shared/redmine-server] => ${target location}

2.1. fatab
예시>
host.myserver.com:/home /mnt/home nfs rw,hard,intr,rsize=8192,wsize=8192,timeo=14 0 0

Leave a Reply

Your email address will not be published. Required fields are marked *