본문 바로가기
웹서버

간단하게 글로 보는 linux NFS 서버 설정 (CentOS, Rocky)

by 대도루피 2023. 5. 23.
반응형

오래전 노트에 적어둔것을 블로그에 정리.

 

yum install -y nfs-utils nfs-utils-lib 

포트설정 
/etc/sysconfig/nfs 수정 

LOCKD_TCPPORT=32803 
LOCKD_UDPPORT=32769 
MOUNTD_PORT=892 
RQUOTAD_PORT=875 
STATD_PORT=600 
STATD_OUTGOING_PORT=601

 
공유디렉토리 설정 

vi /etc/exports 

/storage xxx.xxx.xxx.xxx(rw,sync,no_root_squash) 192.168.111.0/24(rw,sync,no_root_squash)


방화벽 설정 - iptables 설정 변경(생략)

서비스 시작 

service rpcbind start 
service nfslock start 
service nfs start


 서비스 등록 

chkconfig --level 35 nfs on 
chkconfig --level 35 nfslock on 
chkconfig --level 35 rpcbind on


클라이언트 설치 

yum install nfs-utils nfs-utils-lib 
mkdir /디렉토리 
mount 192.168.111.11:/storage /storage 
umount /storage 
/etc/fstab 
192.168.111.11:/storage /storage nfs hard 0 0


exportfs -a  - exports 설정 변경 적용 

반응형