본문 바로가기
Tip

NFS file shareing

by 단창 2015. 3. 27.

내가 사용하는 Fedora16 기준


<server side> 



[설치 ]

[root@master ~]# yum -y install nfs-utils

[root@master ~]# vi /etc/idmapd.conf

# line 5: uncomment and change to your domain name

#Domain = server.world

[설정]

[root@master ~]# vi /etc/exports


/etc/exports 가 nfs 공유 대상 폴더 클라이언트 지정을 해주는 파일

/home 10.0.0.0(rw,sync,no_root_squash,no_all_squash) 10.0.0.1(rw,sync,no_root_squash,no_all_squash) 10.11.21.33(rw,sync,no_root_squash,no_all_squash) 


/etc/exports 파일의 옵션

ro : read only 

rw : read/write 

no_root_squash, root_squash : NFS 서버에도 root 사용자가 있을 것이고, NFS 클라이언트에도 root가 있을 것이다. 그러나 두 root가 같은 root가 될 순 없다. NFS 클라이언트의 root가 NFS 서버의 root 권한을 가질 수 없다. 따라서 기본값은 root_squash로 클라이언트 root는 nobody와 같은 사용자로 맵핑되어 버린다. 서버와 클라언트의 root 사용자를 일치하도록 하려면 no_root_squash라고 적으면 된다. 

no_subtree_check : 공유된 directory내에 있는 서브 directory들을 공유에서 제외시키는 경우 설정. 

sync, async 등이 있다. 


/home ⇒ shared directory

10.0.0.0, 10.0.0.1, 10.11.21.33 ⇒  허용한 client 의 ip

rw ⇒ writable

sync ⇒ synchronize

no_root_squash ⇒ enable root privilege

no_all_squash ⇒ enable users' authority


네트워크 접근 permission 확인

cat /etc/hosts.allow 
ALL:ALL 
cat /etc/hosts.deny 
내용없음.




[root@master ~]# systemctl start rpcbind.service 

[root@master ~]# systemctl start nfs-server.service 

[root@master ~]# systemctl start nfs-lock.service 

[root@master ~]# systemctl start nfs-idmap.service 


[root@master ~]# systemctl enable rpcbind.service 

[root@master ~]# systemctl enable nfs-server.service 

[root@master ~]# systemctl enable nfs-lock.service 

[root@master ~]# systemctl enable nfs-idmap.service 


재부팅하면 다시 시작해 줘야 한다. 

부팅 프로세스에 포함되게 하는것 나중에 업데이트.. 


----------------------------------------------------------------------------------------------

[그외]

showmount 명령어 

NFS 공유 상태 및 정보 확인 명령어


- NFS 서버 마운트 정보 확인

/usr/sbin/showmount

- NFS 서버 마운트 정보와 마운트 디렉토리 확인

showmount -a

- 특정 호스트 마운트 디렉토리 확인

showmount -d 호스트명

- /etc/exports의 마운트 허용 호스트명과 마운트 포인트 확인

showmount -e



=======================================================

ubuntu 

http://darksoulstory.tistory.com/9

이링크에서 portmap 대신 rpcbind



반응형