서버 설정 · 6 min read · Nov 26, 2025
우분투에 GlusterFS 설치 및 구성 방법

GlusterFS는 Gluster Inc.에서 처음 개발하고 이후 Redhat에서 개발한 무료 오픈 소스 확장 가능한 네트워크 파일 시스템입니다. 클라우드 스토리지, CDN 및 미디어 스트리밍과 같은 데이터 집약적인 작업 부하를 위해 특별히 설계되었습니다. 페타바이트의 데이터를 처리할 수 있으며, 따라서 수천 명의 클라이언트에 서비스를 제공할 수 있습니다. NFS, SMB, CIFS, HTTP 및 FTP와 같은 다양한 프로토콜을 지원합니다. GlusterFS를 사용하면 서로 다른 디스크 저장소 리소스를 단일 글로벌 네임스페이스로 결합할 수 있습니다.
이 튜토리얼에서는 우분투 18.04에서 복제된 GlusterFS 볼륨을 설정하는 방법을 배웁니다.
요구 사항
- 각 서버에 2GB 외장 HDD가 장착된 두 대의 우분투 18.04 서버.
- 노드1에는 정적 IP 주소 172.20.10.5가 구성되어 있고, 노드2에는 172.20.10.6이 구성되어 있습니다.
- 두 서버 모두에 루트 비밀번호가 구성되어 있습니다.
시작하기
시작하기 전에 두 서버를 최신 버전으로 업데이트해야 합니다. 두 서버에서 다음 명령어를 실행하여 업데이트할 수 있습니다.
apt-get update -y
apt-get upgrade -y두 서버가 업데이트되면 변경 사항을 적용하기 위해 재부팅합니다.
다음으로, 두 서버에서 호스트 이름 해상도를 설정해야 하므로 각 서버가 호스트 이름으로 서로 통신할 수 있습니다. 두 서버의 /etc/hosts 파일을 편집하여 수행할 수 있습니다:
nano /etc/hosts다음 줄을 추가합니다:
172.20.10.5 node1
172.20.10.6 node2
작업이 완료되면 파일을 저장하고 닫습니다.
GlusterFS 설치
먼저, 두 서버에 GlusterFS 패키지를 설치해야 합니다. 기본적으로 GlusterFS는 우분투 18.04 기본 저장소에 없습니다. 따라서 두 서버에 GlusterFS 저장소를 추가해야 합니다.
먼저, 다음 명령어로 필요한 패키지를 설치합니다:
apt-get install software-properties-common -y다음으로, 다음 명령어로 저장소를 추가합니다:
add-apt-repository ppa:gluster/glusterfs-5다음으로, 다음 명령어로 GlusterFS 서버를 설치합니다:
apt-get install glusterfs-server -y설치가 완료되면 다음 명령어로 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; enabled; vendor preset: enabled)
Active: active (running) since Thu 2019-11-07 12:51:15 UTC; 48s ago
Main PID: 7199 (glusterd)
Tasks: 8 (limit: 505)
CGroup: /system.slice/glusterd.service
??7199 /usr/sbin/glusterd -p /var/run/glusterd.pid --log-level INFO
Nov 07 12:51:06 ubuntu systemd[1]: Starting GlusterFS, a clustered file-system server...
Nov 07 12:51:15 ubuntu systemd[1]: Started GlusterFS, a clustered file-system server.
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 /glusterdata다음으로, /dev/sdb1 디스크를 /glusterdata 디렉토리에 마운트합니다.
mount.xfs /dev/sdb1 /glusterdata다음으로, /etc/fstab 파일을 편집하여 재부팅 시 마운트를 지속적으로 유지합니다:
nano /etc/fstab다음 줄을 추가합니다:
/dev/sdb1 /glusterdata xfs defaults 0 0
작업이 완료되면 파일을 저장하고 닫은 후, 다음 명령어를 실행하여 변경 사항을 적용합니다:
mount -a다음 명령어로 마운트된 디렉토리를 확인할 수 있습니다:
df -h다음과 같은 출력을 볼 수 있어야 합니다:
Filesystem Size Used Avail Use% Mounted on
udev 211M 0 211M 0% /dev
tmpfs 49M 1016K 48M 3% /run
/dev/sda2 30G 4.3G 25G 16% /
tmpfs 241M 12K 241M 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 241M 0 241M 0% /sys/fs/cgroup
/dev/loop0 87M 87M 0 100% /snap/core/4486
tmpfs 49M 0 49M 0% /run/user/0
/dev/loop1 90M 90M 0 100% /snap/core/7917
/dev/sdb1 2.0G 35M 2.0G 2% /glusterdata
GlusterFS 볼륨 구성
먼저, 노드1에서 노드2를 추가하여 신뢰할 수 있는 스토리지 풀을 생성해야 합니다. 이를 위해 노드1에서 다음 명령어를 실행합니다:
gluster peer probe node2다음 명령어로 스토리지 풀을 나열할 수 있습니다:
gluster pool list다음과 같은 출력을 얻을 수 있어야 합니다:
UUID Hostname State
d049b519-9210-4bfa-a1c6-0d1454a88ea0 node2 Connected
dbb9252e-6082-4d31-aaef-1b99e0e0c369 localhost Connected
다음으로, 두 노드에서 다음 명령어로 벽돌 디렉토리를 생성합니다:
mkdir /glusterdata/vol1다음으로, 두 개의 복제본이 있는 vol1이라는 이름의 볼륨을 생성합니다:
gluster volume create vol1 replica 2 node1:/glusterdata/vol1 node2:/glusterdata/vol1다음으로, 다음 명령어로 볼륨을 시작합니다:
gluster volume start vol1다음 명령어로 생성된 볼륨의 상태를 확인할 수 있습니다:
gluster volume status다음과 같은 출력을 얻을 수 있어야 합니다:
Status of volume: vol1
Gluster process TCP Port RDMA Port Online Pid
------------------------------------------------------------------------------
Brick node1:/glusterdata/vol1 49152 0 Y 7987
Brick node2:/glusterdata/vol1 49152 0 Y 18565
Self-heal Daemon on localhost N/A N/A Y 8010
Self-heal Daemon on node2 N/A N/A Y 18588
Task Status of Volume vol1
------------------------------------------------------------------------------
There are no active volume tasks
다음 명령어로 생성된 볼륨에 대한 정보를 볼 수 있습니다:
gluster volume info vol1다음과 같은 출력을 얻을 수 있어야 합니다:
Volume Name: vol1
Type: Replicate
Volume ID: e093ae7a-70ac-42b8-ab3f-a8bd186c5740
Status: Started
Snapshot Count: 0
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: node1:/glusterdata/vol1
Brick2: node2:/glusterdata/vol1
Options Reconfigured:
transport.address-family: inet
nfs.disable: on
performance.client-io-threads: off
다음으로, /etc/fstab 파일을 편집하여 두 노드의 /mnt 디렉토리에 생성된 볼륨을 마운트하여 서버가 부팅된 후에도 볼륨을 사용할 수 있도록 합니다.
nano /etc/fstab다음 줄을 추가합니다:
localhost:/vol1 /mnt glusterfs defaults,_netdev 0 0
작업이 완료되면 파일을 저장하고 닫은 후, 다음 명령어를 실행하여 변경 사항을 적용합니다:
mount -a복제 테스트
이제 GlusterFS 서버가 설치되고 구성되었습니다. 두 노드 간의 복제를 테스트할 시간입니다.
먼저, 노드1에서 두 개의 파일을 생성합니다:
touch /mnt/file1 /mnt/file2이제 노드2로 가서 다음 명령어를 실행합니다:
ls -l /mnt/노드1에서 생성한 동일한 파일을 볼 수 있어야 합니다:
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
이제 노드2에서 GlusterFS 서비스를 중지합니다:
service glusterd stop다음으로, 노드1로 가서 피어 상태를 확인합니다:
gluster peer status노드2가 연결이 끊어진 것을 볼 수 있어야 합니다:
Number of Peers: 1
Hostname: node2
Uuid: d049b519-9210-4bfa-a1c6-0d1454a88ea0
State: Peer in Cluster (Disconnected)
다음 명령어로 볼륨 상태를 확인할 수 있습니다:
gluster volume status다음과 같은 출력을 볼 수 있어야 합니다:
Status of volume: vol1
Gluster process TCP Port RDMA Port Online Pid
------------------------------------------------------------------------------
Brick node1:/glusterdata/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
다음으로, 노드1에서 두 개의 다른 파일을 생성합니다:
touch /mnt/file3 /mnt/file4이제 노드2로 가서 다음 명령어로 GlusterFS 서비스를 시작합니다:
service glusterd start이제 노드2의 /mnt 디렉토리를 확인합니다:
ls -l /mnt/노드1의 모든 파일이 복제되어 이제 사용할 수 있어야 합니다.
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
-rw-r--r-- 1 root root 0 Nov 7 13:44 file3
-rw-r--r-- 1 root root 0 Nov 7 13:44 file4
결론
축하합니다! 우분투 18.04 서버에 두 노드 복제 Glusterfs 볼륨을 성공적으로 설치하고 구성했습니다. 분산 Glusterfs 볼륨, 분산 복제 Glusterfs 볼륨, 스트라이프 Glusterfs 볼륨 및 분산 스트라이프 Glusterfs 볼륨도 설정할 수 있습니다.
새 게시물을 받은 편지함에서 받기
스팸은 없습니다. 언제든지 구독 해지 가능합니다.