Notice
Recent Posts
Recent Comments
Link
«   2024/09   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
Tags
more
Archives
Today
Total
관리 메뉴

클라우드 엔지니어 꿈나무

RHEL NFS 설정 본문

Linux

RHEL NFS 설정

새싹싹이 2024. 3. 30. 18:08

servera: NFS-Server

serverb: Client Server 

 

servera

ip: 10.0.0.1

 

#rpm -qa | grep nfs

nfs 서버 설치 여부 확인

 

#yum install -y nfs-utils 

nfs 서버가 설치되지 않았으면 nfs-utils 다운로드

 

#systemctl enable --now rpcbind

rpcbind 활성화 (rpcbind는 RPC 서버가 사용하는 포트 번호와 해당 서비스의 위치를 클라이언트에게 알려주는 역할)

 

#systemctl enable --now nfs-server

nfs-server 활성화

 

#mkdir /share

공유 폴더 생성

 

#chmod 644 /share클라이언트에서도 사용할 수 있도록 share 권한 설정

 

#vi /etc/exports

/share 10.0.0.*(rw,no_root_squash,sync)

 

#exportfs -a

변경 설정 적용

 

#exportfs

적용 여부 확인

 

 

#firewall-cmd --zone=public --add-service=nfs --permanent

#firewall-cmd --zone=public --add-service=rpc-bind --permanent

#firewall-cmd --zone=public --add-service=mountd --permanent

#firewall-cmd --reload

nfs, rpc-bind, mountd 방화벽 설정

 


serverb

ip: 10.0.0.2

 

#yum install -y nfs-utils

nfs-utils 설치

 

#systemctl enable --now rpcbind

rpcbind 활성화

 

#showmount -e 10.0.0.1

nfs서버에서 export한 목록 확인

 

#rpcinfo -p 10.0.0.1

 

 

#mkdir share1

servera 공유 폴더에 마운트 할 폴더 생성

 

#mount -t nfs -o rw,sync 10.0.0.1:/share /share1

servera 의 share 폴더에서 serverb의 share1 폴더를 마운트

 

#dh -h

마운트 확인

 

#vi /etc/fstab

mount의 경우, 재부팅 하면 mount가 해제되기 때문에 재부팅 후, mount 해제가 되지 않게 fstab 파일 변경

10.0.0.1:/share         /share1                 nfs     defualts        0 0

 


공유 폴더 확인

servera

#cat > hello.txt <<EOF

파일 생성

 

serverb

 

 

 

<<참고>>

시간 때문에 실시간으로 복사가 안될 수도 있기 때문에 시간 설정 필수

https://hiheey.tistory.com/58

 

Chrony 다운로드 및 설정 (시스템 시간 동기화) - Centos7

Chrony : Linux NTP 용 패키지 NTP(Network Time Protocol): 컴퓨터 및 네트워크 장치들 간에 정확한 시간 정보 동기화 #yum install -y dnf #dnf install -y chrony #vi /etc/chrony.conf 하기 그림에서 3~6열 주석 처리 및 7열에

hiheey.tistory.com

 

 

 

https://hiheey.tistory.com/179

 


Auto FS를 자동 마운트 하도록 구성

 

- 넷 사용자 X의 홈 디렉토리를 classroom.example.com에서 이용 가능한 NFS 통해서 내보냄

- (172.25.254.254)와 NFS  디렉토리는 netuser의 /netdir

- 넷유저 X의 홈디렉토리는 serverb:/home/guests/netuserX

- 넷유저 X의 홈디렉토리는 autofs 서비스에 자동 마운트

- 유저들에 홈 디렉토리에 작성 권한 부여

- 넷유저의 패스워드는 ablerate

 

#useradd netuserx

 

# echo "souspolo" | passwd --stdin netuserx

 

# yum install -y nfs-utils autofs

/netdir /etc/auto.misc

 

 

# vi /etc/auto.misc

netuserx         -fstype=nfs,rw,sync serverb:/home/netuserx

 

 

# systemctl restart autofs

 

# firewall-cmd --permanent --add-service=nfs --zone=libvirt

# firewall-cmd --permanent --add-service=rpv-bind --zone=libvirt

# firewall-cmd --permanent --add-service=mountd --zone=libvirt

 

# firewall-cmd --reload

 

# su - netsuerx

'Linux' 카테고리의 다른 글

Centos9 디렉토리 권한 설정  (0) 2024.03.31
CentOS9 Crontab 작업 스케쥴링  (0) 2024.03.31
VMware Ubuntu Xshell로 접속하기  (0) 2024.02.03
Openshift ipi 설치  (0) 2023.11.07
ESXi - HAProxy를 활용하여 웹 접속  (1) 2023.11.02