■ NFS ( Network File System )
· Linux / Unix 컴퓨터 간에 저장공간을 공유하게 해주는 서비스
· Server 저장공간의 Resource를 마치 자신의 Resource인 것처럼 사용할 수 있도록 지원
■ NFS 구축 / 사용
□ Server
1) nfs-utils이 설치되어 있는지 확인
# rpm -qa nfs-utils
2) exports 파일에 공유 설정
# vim /etc/exports
-----------------------------
/share 192.168.56.*(rw,sync)
-----------------------------
· rw : 읽고 쓸 수 있는 권한 부여
· sync : nfs로 쓰기할 경우 디스크 동기화를 하겠다는 옵션 / 충돌 방지
ex) A하고 작업할 경우 A만 통신 가능
3) 공유 디렉토리 생성
# mkdir /share
· share 공유 디렉토리 생성
4) share 디렉토리 권한 설정
# chmod 777 /share
5) share 디렉토리에 간단한 파일 생성
# echo 1 > 1.txt
# echo 2 > 2.txt
# echo "hello world" > hello
6) NFS-SERVER 실행
# systemctl restart nfs-server
# systemctl enable nfs-server
· # exportfs -v => 파일을 볼 수 있음
7) NFS-SERVER 방화벽 설정
# firewall-cmd --permanent --add-service=mountd
# firewall-cmd --permanent --add-service=rpc-bind
# firewall-cmd --permanent --add-service=nfs
# firewall-cmd --reload
# netstat -tnlp => 방화벽 설정 확인
□ Client
1) nfs-utils 설치 유무 확인
# rpm -qa nfs-utils
2) showmount
# showmount -e [서버IP]
3) mount
# mount -t nfs [서버IP]:/share /nfs_share
· server의 share 디렉토리에 client nfs_share 디렉토리를 mount
4) 실제 client의 nfs_share 디렉토리 내의 파일
5) mount 해제
# umount /nfs_share
'Linux' 카테고리의 다른 글
[Linux] Hostname 변경 (0) | 2021.09.06 |
---|---|
[Linux] ssh-keygen (0) | 2021.09.06 |
[Linux] 네트워크 설정 (0) | 2021.08.24 |
[Linux] FTP (0) | 2021.08.24 |
[Linux] SELinux (0) | 2021.08.24 |