GlusterFS 설치 · 6 min read · Nov 30, 2025

우분투 22.04에 GlusterFS 설치 및 구성하는 방법

GlusterFS는 Gluster Inc.에서 개발한 무료 오픈 소스 소프트웨어 정의 분산 스토리지로, 이후 Redhat에 의해 개발되었습니다. 객체, 블록 및 파일 스토리지에 대한 인터페이스를 제공하며 클라우드 스토리지, CDN 및 미디어 스트리밍과 같은 데이터 집약적인 작업에 사용됩니다. 여러 페타바이트의 데이터를 저장하기 위해 빌딩 블록 방식으로 확장할 수 있습니다. NFS, SMB, CIFS, HTTP 및 FTP와 같은 여러 프로토콜을 지원합니다. 대량의 데이터를 처리해야 하는 다양한 사용 사례에 완벽하게 적합합니다.

이 튜토리얼에서는 우분투 22.04에서 복제된 GlusterFS 볼륨을 설정하는 방법을 배웁니다.

요구 사항

  • 각 서버에 2GB 외장 하드디스크가 장착된 우분투 22.04를 실행하는 두 대의 서버.
  • node1에 192.168.10.10의 정적 IP 주소가 구성되어 있고 node2에 192.168.10.11이 구성되어 있습니다.
  • 두 서버 모두에 루트 비밀번호가 구성되어 있습니다.

시작하기

시작하기 전에 두 서버의 모든 시스템 패키지를 업데이트하는 것이 좋습니다. 다음 명령어를 두 서버에서 실행하여 업데이트할 수 있습니다.

apt-get update -y  
apt-get upgrade -y

모든 시스템 패키지가 업데이트되면 변경 사항을 적용하기 위해 서버를 재시작합니다.

다음으로, 두 서버의 /etc/hosts 파일을 편집하고 각 서버가 호스트 이름으로 서로 통신할 수 있도록 호스트 이름 해상도를 설정해야 합니다. 다음 명령어로 수행할 수 있습니다:

nano /etc/hosts

다음 줄을 추가합니다:

192.168.10.10 node1
192.168.10.11 node2

작업이 끝나면 파일을 저장하고 닫습니다.

GlusterFS 서버 설치

기본적으로 GlusterFS는 우분투 22.04 기본 저장소에서 사용할 수 있습니다. 다음 명령어를 사용하여 두 서버에 설치할 수 있습니다.

apt-get install glusterfs-server -y

GlusterFS 패키지가 설치되면 다음 명령어로 GlusterFS 서비스를 시작하고 부팅 시 자동으로 시작되도록 설정합니다:

systemctl start glusterd  
systemctl enable glusterd

다음 명령어로 GlusterFS 서비스의 상태를 확인할 수 있습니다:

systemctl status glusterd

다음과 같은 출력을 볼 수 있어야 합니다:

? glusterd.service - GlusterFS, a clustered file-system server
     Loaded: loaded (/lib/systemd/system/glusterd.service; disabled; vendor preset: enabled)
     Active: active (running) since Sat 2022-11-05 04:10:13 UTC; 7s ago
       Docs: man:glusterd(8)
    Process: 92014 ExecStart=/usr/sbin/glusterd -p /var/run/glusterd.pid --log-level $LOG_LEVEL $GLUSTERD_OPTIONS (code=exited, status=0/SUCC>
   Main PID: 92015 (glusterd)
      Tasks: 9 (limit: 4579)
     Memory: 7.1M
        CPU: 2.260s
     CGroup: /system.slice/glusterd.service
             ??92015 /usr/sbin/glusterd -p /var/run/glusterd.pid --log-level INFO

Nov 05 04:10:11 ubuntu2204 systemd[1]: Starting GlusterFS, a clustered file-system server...
Nov 05 04:10:13 ubuntu2204 systemd[1]: Started GlusterFS, a clustered file-system server.

작업이 끝나면 다음 단계로 진행할 수 있습니다.

GlusterFS 스토리지 생성

GlusterFS 스토리를 생성하려면 두 서버에 외장 하드 디스크가 필요합니다. 또한 두 서버의 외장 하드 디스크(/dev/sdb)에 파티션을 생성해야 합니다.

/dev/sdb에 새 파티션을 생성하려면 다음 명령어를 실행합니다:

fdisk /dev/sdb

다음과 같은 출력을 볼 수 있어야 합니다:

Welcome to fdisk (util-linux 2.31.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x06091fe8.

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 
First sector (2048-4194303, default 2048): 
Last sector, +sectors or +size{K,M,G,T,P} (2048-4194303, default 4194303): 

Created a new partition 1 of type 'Linux' and of size 2 GiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

다음으로, 다음 명령어로 파티션을 포맷합니다:

mkfs.xfs /dev/sdb1

다음과 같은 출력을 볼 수 있어야 합니다:

meta-data=/dev/sdb1              isize=512    agcount=4, agsize=131008 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=0, rmapbt=0, reflink=0
data     =                       bsize=4096   blocks=524032, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

다음으로, 다음 명령어로 두 서버에 GlusterFS 스토리지를 위한 디렉토리를 생성합니다:

mkdir /glustervolume

다음으로, /dev/sdb1 디스크를 /glustervolume 디렉토리에 마운트합니다.

mount.xfs /dev/sdb1 /glustervolume

다음으로, /etc/fstab 파일을 편집하여 재부팅 시 마운트를 지속적으로 유지합니다:

nano /etc/fstab

다음 줄을 추가합니다:

/dev/sdb1 /glustervolume xfs defaults 0 0

작업이 끝나면 파일을 저장하고 닫은 후 다음 명령어를 실행하여 변경 사항을 적용합니다:

mount -a

다음 명령어로 마운트된 디렉토리를 확인할 수 있습니다:

df -h

다음과 같은 출력을 볼 수 있어야 합니다:

Filesystem      Size  Used Avail Use% Mounted on
tmpfs           393M  1.1M  392M   1% /run
/dev/sda2        79G  8.6G   67G  12% /
tmpfs           2.0G     0  2.0G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           393M  4.0K  393M   1% /run/user/0
/dev/sdb1       2.0G   35M  2.0G   2% /glustervolume

GlusterFS 볼륨 구성

먼저, node2를 node1에 추가하여 신뢰할 수 있는 스토리지 풀을 생성해야 합니다. 이를 위해 node1에서 다음 명령어를 실행합니다:

gluster peer probe node2

다음 명령어로 추가된 스토리지 풀을 확인할 수 있습니다:

gluster pool list

다음과 같은 출력을 받아야 합니다:

UUID                        Hostname    State
52245177-ce2e-4217-8da5-2ee7a33dcf46    node2       Connected 
b6da6e83-b1ea-46de-8904-1c5345b1c229    localhost   Connected 

다음으로, 다음 명령어로 두 노드에 벽돌 디렉토리를 생성합니다:

mkdir /glustervolume/vol1

다음으로, 두 개의 복제본을 가진 vol1이라는 이름의 볼륨을 생성합니다:

gluster volume create vol1 replica 2 node1:/glustervolume/vol1 node2:/glustervolume/vol1

다음으로, 다음 명령어로 볼륨을 시작합니다:

gluster volume start vol1

다음 명령어로 생성된 볼륨의 상태를 확인할 수 있습니다:

gluster volume status

다음과 같은 출력을 받아야 합니다:

Status of volume: vol1
Gluster process                             TCP Port  RDMA Port  Online  Pid
------------------------------------------------------------------------------
Brick node1:/glustervolume/vol1               49152     0          Y       7198 
Brick node2:/glustervolume/vol1               49152     0          Y       13214
Self-heal Daemon on localhost               N/A       N/A        Y       6121 
Self-heal Daemon on node2                   N/A       N/A        Y       12768
 
Task Status of Volume vol1
------------------------------------------------------------------------------
There are no active volume tasks

이제 다음 명령어로 생성된 볼륨에 대한 정보를 확인할 수 있습니다:

gluster volume info vol1

다음과 같은 출력을 받아야 합니다:

Volume Name: vol1
Type: Replicate
Volume ID: a1023sd6d-81rt-12a2-bc4e-a4gd156c5331
Status: Started
Snapshot Count: 0
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: node1:/glustervolume/vol1
Brick2: node2:/glustervolume/vol1
Options Reconfigured:
transport.address-family: inet
nfs.disable: on
performance.client-io-threads: off

다음으로, /etc/fstab 파일을 편집하여 /opt 디렉토리에 생성된 볼륨을 마운트하여 서버가 부팅된 후에도 볼륨을 사용할 수 있도록 합니다.

nano /etc/fstab

다음 줄을 추가합니다:

localhost:/vol1 /opt glusterfs defaults,_netdev 0 0

작업이 끝나면 파일을 저장하고 닫은 후 다음 명령어를 실행하여 변경 사항을 적용합니다:

mount -a

복제 테스트

이제 GlusterFS 서버가 설치되고 구성되었습니다. 이제 두 노드 간의 복제를 테스트할 시간입니다.

먼저, node1에서 두 개의 파일을 생성합니다:

touch /opt/test1 /opt/test2

이제 node2로 가서 다음 명령어를 실행합니다:

ls -l /opt/

node1에서 생성한 동일한 파일을 볼 수 있어야 합니다:

total 0
-rw-r--r-- 1 root root 0 Nov  7 13:42 file1
-rw-r--r-- 1 root root 0 Nov  7 13:42 file2

이제 node2에서 GlusterFS 서비스를 중지합니다:

service glusterd stop

다음으로, node1로 가서 피어 상태를 확인합니다:

gluster peer status

node2가 연결이 끊어진 것을 볼 수 있어야 합니다:

Number of Peers: 1

Hostname: node2
Uuid: a134f146-1220-3avd-d3f6-1c2554a87sa1
State: Peer in Cluster (Disconnected)

다음 명령어로 볼륨 상태를 확인할 수 있습니다:

gluster volume status

다음과 같은 출력을 볼 수 있어야 합니다:

Status of volume: vol1
Gluster process                             TCP Port  RDMA Port  Online  Pid
------------------------------------------------------------------------------
Brick node1:/glustervolume/vol1               49152     0          Y       7987 
Self-heal Daemon on localhost               N/A       N/A        Y       8010 
 
Task Status of Volume vol1
------------------------------------------------------------------------------
There are no active volume tasks

다음으로, node1에서 다른 두 개의 파일을 생성합니다:

touch /opt/test3 /opt/test4

이제 node2로 가서 다음 명령어로 GlusterFS 서비스를 시작합니다:

service glusterd start

이제 node2의 /opt 디렉토리를 확인합니다:

ls -l /opt/

node1에서 모든 파일이 복제되어 이제 사용할 수 있어야 합니다:

total 0
-rw-r--r-- 1 root root 0 Nov  7 13:42 test1
-rw-r--r-- 1 root root 0 Nov  7 13:42 test2
-rw-r--r-- 1 root root 0 Nov  7 13:44 test3
-rw-r--r-- 1 root root 0 Nov  7 13:44 test4

결론

축하합니다! 우분투 22.04 서버에 두 노드 복제 GlusterFS 서버를 성공적으로 설치하고 구성했습니다. 더 많은 정보는 GlusterFS 문서 페이지를 읽어보세요. 질문이 있으면 언제든지 문의해 주세요.

Share: X/Twitter LinkedIn

새 게시물을 받은 편지함에서 받기

스팸은 없습니다. 언제든지 구독 해지 가능합니다.