Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Test 환경 :

  • Server - Ubuntu

...

  • 18.04

...

  • Client - CentOS 7

Table of Contents

Server

NFS Package 설치

Code Block
languageactionscript3
apt-get update
apt-get install nfs-common nfs-kernel-server rpcbind

공유할 디렉토리 생성

Code Block
languageactionscript3
mkdir -p /home/share/jira
chmod 755 /home/share/jira
chown -R twoseed:twoseed /home/share/jira

/etc/exports 파일에 추가

vi /etc/exports

Code Block
languageactionscript3
/home/share 175.197***.***.124.*(rw,sync,no_root_squash,no_all_squash)
# [/경로] [허용할 IP주소. *은 모두 허용](옵션)

...

Expand
title옵션 목록
Code Block
languageactionscript3
ro : 읽기 전용
rw : 읽기 / 쓰기
no_root_squash : 클라이언트 쪽 root도 서버 쪽 root와 같은 권한 가짐
no_all_squash : root 이외 모든 사용자에 대해 UID가 같으면 같은 권한 가짐
sync : 서버와 클라이언트 사이에 sync 맞춤
insecure : 인증 안되도 접속허가

NFS 서버 재시작

Code Block
languageactionscript3
service nfs-kernel-server restart
service rpcbind restart

Client

NFS Package 설치

Code Block
languageactionscript3
apt-get update
apt-get install nfs-common

공유할 디렉토리 생성

Code Block
languageactionscript3
mkdir -p /data/jira
chmod 755 /data/jira
chown -R twoseed:twoseed /data/jira

NFS 공유 폴더 마운트

Code Block
languageactionscript3
mount -t nfs 175.197***.***.100.150:/home/share/jira /data/jira

Client 서버 재시작시 자동 마운트 설정

vi /etc/exportsfstab

Code Block
languageactionscript3
175.197***.***.100.150:/home/share/jira    /data/jira   nfs defaults 0 0