GlusterFS 설정 · 3 min read · Feb 05, 2026

GlusterFS를 사용한 CentOS 5.4의 네 개 저장 노드에서의 스트라이핑 - 페이지 2

3 GlusterFS 클라이언트 설정

client1.example.com:

GlusterFS는 CentOS 5.4의 패키지로 제공되지 않으므로, 직접 빌드해야 합니다. 먼저 필수 패키지를 설치합니다:

yum groupinstall 'Development Tools'
yum groupinstall 'Development Libraries'
yum install libibverbs-devel fuse-devel

그런 다음 fuse 커널 모듈을 로드합니다…

modprobe fuse

… 그리고 시스템이 부팅될 때마다 fuse 커널 모듈이 자동으로 로드되도록 /etc/rc.modules 파일을 다음 내용으로 생성합니다:

vi /etc/rc.modules

| modprobe fuse |

파일을 실행 가능하게 만듭니다:

chmod +x /etc/rc.modules

그런 다음 GlusterFS 2.0.9 소스를 다운로드합니다 (서버에 설치된 버전과 동일합니다!) 그리고 GlusterFS를 다음과 같이 빌드합니다:

cd /tmp  
wget http://ftp.gluster.com/pub/gluster/glusterfs/2.0/LATEST/glusterfs-2.0.9.tar.gz  
tar xvfz glusterfs-2.0.9.tar.gz  
cd glusterfs-2.0.9  
./configure

./configure 명령의 끝에서 다음과 같은 내용을 볼 수 있어야 합니다:

[...]  
GlusterFS configure summary  
===========================  
FUSE client        : yes  
Infiniband verbs   : yes  
epoll IO multiplex : yes  
Berkeley-DB        : yes  
libglusterfsclient : yes  
argp-standalone    : no
make && make install  
ldconfig

그 후 GlusterFS 버전을 확인합니다 (2.0.9여야 함):

glusterfs --version
[root@client1 glusterfs-2.0.9]# glusterfs --version  
glusterfs 2.0.9 built on Mar 1 2010 15:58:06  
Repository revision: v2.0.9  
Copyright (c) 2006-2009 Gluster Inc.   
GlusterFS comes with ABSOLUTELY NO WARRANTY.  
You may redistribute copies of GlusterFS under the terms of the GNU General Public License.  
[root@client1 glusterfs-2.0.9]#

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

mkdir /mnt/glusterfs  
mkdir /etc/glusterfs

다음으로 /etc/glusterfs/glusterfs.vol 파일을 생성합니다:

vi /etc/glusterfs/glusterfs.vol

| volume remote1 type protocol/client option transport-type tcp/client option remote-host server1.example.com option remote-subvolume brick end-volume volume remote2 type protocol/client option transport-type tcp/client option remote-host server2.example.com option remote-subvolume brick end-volume volume remote3 type protocol/client option transport-type tcp/client option remote-host server3.example.com option remote-subvolume brick end-volume volume remote4 type protocol/client option transport-type tcp/client option remote-host server4.example.com option remote-subvolume brick end-volume volume stripe type cluster/stripe option block-size 1MB subvolumes remote1 remote2 remote3 remote4 end-volume volume writebehind type performance/write-behind option window-size 1MB subvolumes stripe end-volume volume cache type performance/io-cache option cache-size 512MB subvolumes writebehind end-volume |

option 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/mapper/VolGroup00-LogVol00 on / type ext3 (rw)  
proc on /proc type proc (rw)  
sysfs on /sys type sysfs (rw)  
devpts on /dev/pts type devpts (rw,gid=5,mode=620)  
/dev/sda1 on /boot type ext3 (rw)  
tmpfs on /dev/shm type tmpfs (rw)  
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)  
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)  
glusterfs#/etc/glusterfs/glusterfs.vol on /mnt/glusterfs type fuse (rw,allow_other,default_permissions,max_read=131072)  
[root@client1 ~]#

… 그리고…

df -h
[root@client1 ~]# df -h  
Filesystem            Size  Used Avail Use% Mounted on  
/dev/mapper/VolGroup00-LogVol00  
                       29G  2.2G   25G   9% /  
/dev/sda1             99M   13M   82M  14% /boot  
tmpfs                 187M     0  187M   0% /dev/shm  
glusterfs#/etc/glusterfs/glusterfs.vol  
                       112G  2.3G  110G   2% /mnt/glusterfs  
[root@client1 ~]#

( server1.example.com, server2.example.com, server3.example.com, server4.example.com 각각 GlusterFS 파일 시스템을 위해 약 28GB의 공간을 가지고 있으므로, 결과 공유의 크기는 약 4 x 28GB (112GB)입니다.)

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

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

vi /etc/fstab

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

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

reboot

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

df -h

… 그리고…

mount

4 테스트

이제 GlusterFS 공유에 큰 테스트 파일을 생성해 보겠습니다:

client1.example.com:

dd if=/dev/zero of=/mnt/glusterfs/test.img bs=1024k count=1000
ls -l /mnt/glusterfs
[root@client1 ~]# ls -l /mnt/glusterfs  
total 1024032  
-rw-r--r-- 1 root root 1048576000 2010-02-23 17:31 test.img  
[root@client1 ~]#

이제 server1.example.com, server2.example.com, server3.example.com, server4.example.com의 /data/export 디렉토리를 확인해 보겠습니다. 각 노드에서 test.img 파일을 볼 수 있어야 하지만, 데이터 스트라이핑으로 인해 크기는 다를 것입니다:

server1.example.com:

ls -l /data/export
[root@server1 ~]# ls -l /data/export  
total 256008  
-rw-r--r-- 1 root root 1045430272 2010-02-23 17:31 test.img  
[root@server1 ~]#

server2.example.com:

ls -l /data/export
[root@server2 ~]# ls -l /data/export  
total 256008  
-rw-r--r-- 1 root root 1046478848 2010-02-23 17:27 test.img  
[root@server2 ~]#

server3.example.com:

ls -l /data/export
[root@server3 ~]# ls -l /data/export  
total 256008  
-rw-r--r-- 1 root root 1047527424 2010-02-23 17:26 test.img  
[root@server3 ~]#

server4.example.com:

ls -l /data/export
[root@server4 ~]# ls -l /data/export  
total 256008  
-rw-r--r-- 1 root root 1048576000 2010-02-23 17:30 test.img  
[root@server4 ~]#

5 링크

Share: X/Twitter LinkedIn

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

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