알고보면 쓸데있는 신비한 잡학IT노트

Centos NFS 설치&설정

남차장 2020. 12. 30. 16:53

설치

# 서버, 클라이언트 공통 설치
yum install nfs-utils nfs-tils-lib -y

 

설정

# Centos6, 7 동일
vim /etc/exports
#마운트디렉토리----허용아이피(권한/동작)
/data	192.168.0.100(rw,sync)
/data	192.168.1.*(rw.rync)
:wq

#서버에서 재기동 
service nfs restart #Centos6
systemctl restart nfs #Centos7

#클라이언트에서 마운트 가능여부 확인
showmount -e 서버아이피

#클라이언트 nfs 마운트
mount -t nfs 서버아이피:/data /clientmountdirectory

#재부팅시 자동으로 마운트되도록 셋팅
vim /etc/fstab
서버아이피:/data	/clientmountdirectory nfs	hard	0 0
:wq