서버 설정 · 3 min read · Feb 09, 2026

Debian Squeeze에서 GlusterFS 3.0.x로 NFS와 유사한 독립형 스토리지 서버 만들기

이 튜토리얼에서는 Debian Squeeze에서 독립형 스토리지 서버를 설정하는 방법을 보여줍니다. NFS 대신 여기서는 GlusterFS를 사용합니다. 클라이언트 시스템은 로컬 파일 시스템처럼 스토리지에 접근할 수 있습니다. GlusterFS는 여러 페타바이트로 확장할 수 있는 클러스터 파일 시스템입니다. Infiniband RDMA 또는 TCP/IP 상의 다양한 스토리지 브릭을 하나의 대규모 병렬 네트워크 파일 시스템으로 집계합니다. 스토리지 브릭은 SATA-II RAID 및 Infiniband HBA가 있는 x86_64 서버와 같은 일반 하드웨어로 구성될 수 있습니다.

이것이 당신에게 작동할 것이라는 보장은 하지 않습니다!

1 사전 참고

이 튜토리얼에서는 두 시스템, 서버와 클라이언트를 사용합니다:

  • server1.example.com: IP 주소 192.168.0.100 (서버)
  • client1.example.com: IP 주소 192.168.0.101 (클라이언트)

두 시스템 모두 서로의 호스트 이름을 확인할 수 있어야 합니다. DNS를 통해 이를 수행할 수 없는 경우, /etc/hosts 파일을 편집하여 두 시스템 모두 다음과 같이 보이도록 해야 합니다:

vi /etc/hosts

| 127.0.0.1 localhost.localdomain localhost 192.168.0.100 server1.example.com server1 192.168.0.101 client1.example.com client1 # IPv6 기능이 있는 호스트에 대해 다음 줄이 바람직합니다 ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters |

(다음 설정에서 호스트 이름 대신 IP 주소를 사용하는 것도 가능합니다. IP 주소를 사용하려는 경우, 호스트 이름이 확인될 수 있는지 여부에 대해 걱정할 필요가 없습니다.)

2 GlusterFS 서버 설정

server1.example.com:

GlusterFS는 Debian Squeeze용 패키지로 제공되므로, 다음과 같이 설치할 수 있습니다:

apt-get install glusterfs-server

명령어

glusterfs --version

이제 방금 설치한 GlusterFS 버전(이 경우 3.0.5)이 표시되어야 합니다:

root@server1:~# glusterfs --version  
glusterfs 3.0.5 built on Jul 13 2010 16:44:21  
Repository revision: v3.0.5  
Copyright (c) 2006-2009 Gluster Inc.   
GlusterFS는 전혀 보증이 없습니다.  
GNU 일반 공용 라이센스의 조건에 따라 GlusterFS의 복사본을 재배포할 수 있습니다.  
root@server1:~#

다음으로 몇 개의 디렉토리를 생성합니다:

mkdir /data/  
mkdir /data/export  
mkdir /data/export-ns

이제 GlusterFS 서버 구성 파일 /etc/glusterfs/glusterfsd.vol를 생성합니다(먼저 원본 /etc/glusterfs/glusterfsd.vol 파일의 백업을 만듭니다). 이 파일은 어떤 디렉토리가 내보내질 것인지(/data/export)와 어떤 클라이언트가 연결할 수 있는지를 정의합니다(192.168.0.101 = client1.example.com):

cp /etc/glusterfs/glusterfsd.vol /etc/glusterfs/glusterfsd.vol_orig  
cat /dev/null > /etc/glusterfs/glusterfsd.vol  
vi /etc/glusterfs/glusterfsd.vol

| volume posix type storage/posix option directory /data/export end-volume volume locks type features/locks option mandatory-locks on subvolumes posix end-volume volume brick type performance/io-threads option thread-count 8 subvolumes locks end-volume volume server type protocol/server option transport-type tcp option auth.addr.brick.allow 192.168.0.101 # 허용된 클라이언트의 IP 주소(이름)를 쉼표로 구분하여 추가하세요 subvolumes brick end-volume |

IP 주소에 대해 와일드카드를 사용할 수 있으며(예: 192.168.*), 여러 IP 주소를 쉼표로 구분하여 지정할 수 있습니다(예: 192.168.0.101,192.168.0.102).

그 후 GlusterFS 서버를 시작합니다:

/etc/init.d/glusterfs-server start

3 GlusterFS 클라이언트 설정

client1.example.com:

클라이언트에서 GlusterFS 클라이언트를 다음과 같이 설치할 수 있습니다:

apt-get install glusterfs-client

그런 다음 다음 디렉토리를 생성합니다:

mkdir /mnt/glusterfs

다음으로 파일 /etc/glusterfs/glusterfs.vol를 생성합니다(먼저 원본 /etc/glusterfs/glusterfs.vol 파일의 백업을 만듭니다):

cp /etc/glusterfs/glusterfs.vol /etc/glusterfs/glusterfs.vol_orig  
cat /dev/null > /etc/glusterfs/glusterfs.vol  
vi /etc/glusterfs/glusterfs.vol

| volume remote type protocol/client option transport-type tcp option remote-host server1.example.com # IP 또는 호스트 이름 가능 option remote-subvolume brick end-volume volume writebehind type performance/write-behind option window-size 4MB subvolumes remote end-volume volume cache type performance/io-cache option cache-size 512MB subvolumes writebehind end-volume |

옵션 remote-host 줄에 올바른 서버 호스트 이름 또는 IP 주소를 사용해야 합니다!

그게 전부입니다! 이제 다음 두 명령 중 하나를 사용하여 GlusterFS 파일 시스템을 /mnt/glusterfs에 마운트할 수 있습니다:

glusterfs -f /etc/glusterfs/glusterfs.vol /mnt/glusterfs

또는

mount -t glusterfs /etc/glusterfs/glusterfs.vol /mnt/glusterfs

이제 다음의 출력에서 새로운 공유를 확인할 수 있어야 합니다…

mount
root@client1:~# mount  
/dev/sda1 on / type ext3 (rw,errors=remount-ro)  
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)  
proc on /proc type proc (rw,noexec,nosuid,nodev)  
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)  
udev on /dev type tmpfs (rw,mode=0755)  
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)  
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)  
fusectl on /sys/fs/fuse/connections type fusectl (rw)  
/etc/glusterfs/glusterfs.vol on /mnt/glusterfs type fuse.glusterfs (rw,allow_other,default_permissions,max_read=131072)  
root@client1:~#

… 그리고…

df -h
root@client1:~# df -h  
Filesystem            Size  Used Avail Use% Mounted on  
/dev/sda1              29G  778M   27G   3% /  
tmpfs                 249M     0  249M   0% /lib/init/rw  
udev                  244M  100K  244M   1% /dev  
tmpfs                 249M     0  249M   0% /dev/shm  
/etc/glusterfs/glusterfs.vol  
                     29G  1.2G   27G   5% /mnt/glusterfs  
root@client1:~#

클라이언트에서 GlusterFS 공유를 수동으로 마운트하는 대신, /etc/fstab을 수정하여 클라이언트 부팅 시 공유가 자동으로 마운트되도록 할 수 있습니다.

/etc/fstab을 열고 다음 줄을 추가합니다:

vi /etc/fstab

| [...] /etc/glusterfs/glusterfs.vol /mnt/glusterfs glusterfs defaults,_netdev 0 0 |

수정된 /etc/fstab이 작동하는지 테스트하려면 클라이언트를 재부팅합니다:

reboot

재부팅 후, 다음의 출력에서 공유를 찾을 수 있어야 합니다…

df -h

… 그리고…

mount

/etc/fstab을 수정해도 도움이 되지 않는 경우, /etc/fstab의 변경 사항을 취소하고 대신 /etc/rc.local에 이 줄을 추가합니다(0으로 종료하기 전):

vi /etc/rc.local

| [...] /bin/mount -t glusterfs /etc/glusterfs/glusterfs.vol /mnt/glusterfs [...] |

이렇게 하면 네트워크가 활성화된 후 공유가 마운트됩니다.

4 링크

Share: X/Twitter LinkedIn

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

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