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

GlusterFS로 Fedora 12에서 네 개의 스토리지 노드에 걸쳐 스트라이핑 - 페이지 2

3 GlusterFS 클라이언트 설정

client1.example.com:

Fedora 12용 GlusterFS 클라이언트 rpm 패키지가 있지만, 문제는 GlusterFS 공유에 접근하려고 할 때 df: /mnt/glusterfs': 소프트웨어로 인해 연결이 중단되었습니다 또는 df:/mnt/glusterfs’: 전송 엔드포인트가 연결되어 있지 않습니다와 같은 오류가 발생한다는 것입니다. 이러한 문제를 피하기 위해 소스에서 GlusterFS 클라이언트를 빌드합니다.

GlusterFS 클라이언트를 빌드하기 전에 필수 패키지를 설치합니다:

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

그런 다음 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  
  
[root@client1 glusterfs-2.0.9]#
make && make install  
ldconfig

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

glusterfs --version
[root@client1 glusterfs-2.0.9]# glusterfs --version  
glusterfs 2.0.9 built on Feb 19 2010 19:20:46  
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 |

옵션 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/vg_server5-lv_root on / type ext4 (rw)  
proc on /proc type proc (rw)  
sysfs on /sys type sysfs (rw)  
devpts on /dev/pts type devpts (rw,gid=5,mode=620)  
tmpfs on /dev/shm type tmpfs (rw)  
/dev/sda1 on /boot type ext4 (rw)  
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)  
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (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/mapper/vg_server5-lv_root  
                       29G  2.5G   25G  10% /  
tmpfs                 185M     0  185M   0% /dev/shm  
/dev/sda1            194M   23M  161M  13% /boot  
/etc/glusterfs/glusterfs.vol  
                       114G  9.8G   99G  10% /mnt/glusterfs  
[root@client1 ~]#

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

클라이언트에서 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

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

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