IMG-LOGO
공지사항 :

GlusterFS 설치

lmkfox - 2025-05-01 07:05:12 65 Views 0 Comment

GlusterFS 설치 방법을 단계별로 자세히 설명드리겠습니다.

여기서는 CentOS Stream 8 / Rocky Linux / AlmaLinux와 같은 RHEL 계열 리눅스를 기준으로 설명합니다.

다른 배포판(Ubuntu 등)에서도 설치 가능하지만 명령어와 경로가 다를 수 있습니다.


GlusterFS 설치 준비 사항

최소 구성

  • 서버 2대 이상 필요 (replica 구성 시 최소 2대)

  • 각 서버는 GlusterFS가 사용할 디스크 또는 디렉토리를 갖고 있어야 함 (예: /data/brick1)

  • 서버 간 네트워크 통신 가능해야 함 (port 24007, 24008, 49152~49251 등)

  • DNS 또는 /etc/hosts 설정으로 서버 간 이름 확인 가능해야 함

시스템 요구 사항

  • SELinux: 설정에 따라 조정 필요

  • 방화벽: 필요한 포트 허용

  • NTP: 시간 동기화 권장


1단계: GlusterFS 저장소 추가 및 설치

RHEL / CentOS / Rocky Linux

dnf install -y centos-release-gluster  # EPEL 기반 Gluster 저장소 추가
dnf install -y glusterfs-server

Ubuntu (22.04 기준)

add-apt-repository ppa:gluster/glusterfs-11
apt update
apt install -y glusterfs-server


2단계: GlusterFS 서비스 시작

systemctl enable --now glusterd
systemctl status glusterd


3단계: 방화벽 및 SELinux 설정

Firewalld 포트 오픈

firewall-cmd --permanent --add-service=glusterfs
firewall-cmd --reload

SELinux 설정 (필요한 경우)

setsebool -P virt_use_fusefs on
setsebool -P use_fusefs_home_dirs on

또는 설치 테스트 환경에서는 임시로 SELinux를 permissive로 설정할 수도 있습니다.

setenforce 0


4단계: 클러스터 피어 연결

모든 노드에 위의 과정으로 GlusterFS를 설치한 후, 한 서버에서 다른 서버를 피어로 등록합니다.

gluster peer probe <other-node-hostname>
gluster peer status

예시:

gluster peer probe node2


5단계: Brick 디렉토리 생성

각 서버에 GlusterFS에서 사용할 디렉토리를 생성합니다. 이 디렉토리는 실제 데이터를 저장합니다.

mkdir -p /data/brick1
이 디렉토리는 비어 있어야 하며, GlusterFS가 마운트 지점으로 사용합니다.


6단계: 볼륨 생성

예: replica 2 구성

gluster volume create myvol replica 2 \
node1:/data/brick1 node2:/data/brick1 force

  • replica 2: 모든 데이터를 두 서버에 복제

  • force: 동일 호스트 이름 사용 시 강제로 생성


7단계: 볼륨 시작

gluster volume start myvol


8단계: 클라이언트에서 마운트

FUSE 방식 (GlusterFS 설치 필요)

dnf install -y glusterfs-fuse
mount -t glusterfs node1:/myvol /mnt

NFS 방식 (서버에서 Gluster NFS 활성화 필요)

mount -t nfs -o vers=3 node1:/myvol /mnt


9단계: 부팅 시 자동 마운트 설정

/etc/fstab에 추가:

node1:/myvol /mnt glusterfs defaults,_netdev 0 0


10단계: 볼륨 상태 확인

gluster volume info
gluster volume status
gluster volume heal myvol info


요약 명령어 정리

단계

명령어 예시

설치

dnf install glusterfs-server

서비스 시작

systemctl start glusterd

피어 등록

gluster peer probe node2

볼륨 생성

gluster volume create myvol replica 2 node1:/brick1 node2:/brick1

볼륨 시작

gluster volume start myvol

마운트

mount -t glusterfs node1:/myvol /mnt


테스트 및 운영 팁

  • Brick 디스크에 XFS 또는 EXT4 포맷 권장

  • Replica 3 이상을 구성하면 split-brain 방지에 유리

  • Rebalance, Heal 명령어로 데이터 일관성 유지 가능

  • 대량 파일 처리 시 성능 튜닝 필요 (performance.cache-size, io-threads 등)


원하시면 다음도 추가로 안내드릴 수 있습니다:

  • Replica vs Dispersed 구성 차이

  • GlusterFS + Kubernetes 연동 (Heketi 또는 CSI)

  • 성능 최적화 설정

  • 로그 확인 및 장애 분석 방법

추가로 궁금한 설정이나 클러스터 규모가 있다면 알려주세요.


댓글