전자책 출간 알림 [마이크로서비스패턴 쉽게 개발하기]

티스토리 뷰

Agile&DevOps/CI, CD 툴 설치

NFS서버 만들기

Happy@Cloud 2019. 9. 12. 13:00

1. ubuntu

 

 

NFS서버 만들기

k8s에서 Volume으로 사용할 수 있는 종류는 아래와 같이 매우 많습니다. 그 중에 많이 사용하는 volume ty...

blog.naver.com

※ Chrome에서 이미지가 깨지면 다른 브라우저를 이용하세요. 

 

2. centos7 / RHEL7

NFS서버

1) 파일 설치

$ yum install -y nfs nfs-utils cifs-utils rpc-bind

2) 공유할 디렉토리 생성

# mkdir -p /data

3) exports 파일 생성

NFS client들을 등록한다.

$ vi /etc/exports

/data 169.56.102.254(rw,sync,no_subtree_check,no_root_squash)
/data 169.56.102.242(rw,sync,no_subtree_check,no_root_squash)

* 괄호안의 옵션들에 대해선 아래 링크를 참조하세요.

https://blog.iwanhae.ga/nfs_guideline/

* 모든 client VM에 대해서 접근을 허용하려면 IP 대신에 '*'을 사용해도 됩니다.

/data *(rw,sync,no_subtree_check,no_root_squash)

 

4) 설정 적용 위해 재시작

$ systemctl restart nfs

$ systemctl restart nfs-server

$ systemctl enable nfs-server

$ systemctl restart rpcbind

$ exportfs -a

5) 확인

$ exportfs -v

$ rpcinfo -p

 

Clinet 설정

$ yum install -y nfs-utils cifs-utils 

아래와 같이 테스트합니다. 

$ mkdir /ttt

$ mount -t nfs <NFS SERVER IP>:<NFS 디렉토리 경로>   /ttt

ex) mount -t nfs 169.56.102.254:/data /ttt

정상적으로 되면 mount해제하고, /ttt를 지웁니다.

$ umount /ttt

$ rm -rf /ttt

 

3. centos8 /  RHEL8

아래 글에 자세히 나와 있습니다.

www.tecmint.com/install-nfs-server-on-centos-8/

 

How to Set Up NFS Server and Client on CentOS 8

Network File System (NFS) also known as client/server file system is a popular, cross-platform and distributed file system protocol used to export local file systems over the network so that clients can share directories and files with others over a networ

www.tecmint.com

간단히 정리하면 아래와 같습니다.

* dnf는 dandified YUM의 약자로 패키지 설치관리자인 yum의 새로운 버전임

1) NFS서버에서 작업

# library설치
dnf install nfs-utils cifs-utils

# nfs-server 시작 프로그램 등록 및 시작
systemctl enable nfs-server.service --now

# nfs directory 작성
mkdir /data
chmod 777 /data

# nfs client 등록 (ip는 nfs 사용할 node의 ip)
vi /etc/exports 로 열어 아래와 같이 worker node IP등록 

/data 10.178.32.134(rw,sync,no_subtree_check,no_root_squash)

# 설정 export
exportfs -arv

 

2) 각 NFS Client에서 작업

# library 설치
dnf install nfs-utils nfs4-acl-tools cifs-utils

# nfs mount 가능 여부 체크( nfs 서버 ip 이용)
showmount -e 10.178.32.135

# TEST
mkdir -p /mnt/data
mount -t nfs 10.178.32.135:/data /mnt/data
mount | grep nfs

umount /mnt/data

 

'Agile&DevOps > CI, CD 툴 설치' 카테고리의 다른 글

Nexus 설치 및 구성  (0) 2020.06.12
Private image registry 설치  (0) 2019.09.12
sonarqube 설치  (0) 2019.09.12
Jenkins 설치  (0) 2019.09.12
gitlab 설치  (0) 2019.09.12
댓글

전자책 출간 알림 [마이크로서비스패턴 쉽게 개발하기]