GlusterFS 설정 · 3 min read · Feb 04, 2026
Fedora 12에서 GlusterFS로 네 개의 저장소 노드에 분산 저장 설정 - 페이지 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 option remote-host server1.example.com option remote-subvolume brick end-volume volume remote2 type protocol/client option transport-type tcp option remote-host server2.example.com option remote-subvolume brick end-volume volume remote3 type protocol/client option transport-type tcp option remote-host server3.example.com option remote-subvolume brick end-volume volume remote4 type protocol/client option transport-type tcp option remote-host server4.example.com option remote-subvolume brick end-volume volume distribute type cluster/distribute subvolumes remote1 remote2 remote3 remote4 end-volume volume writebehind type performance/write-behind option window-size 1MB subvolumes distribute 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… 그리고…
mount4 테스트
이제 GlusterFS 공유에 테스트 파일을 생성해 보겠습니다:
client1.example.com:
touch /mnt/glusterfs/test1
touch /mnt/glusterfs/test2
touch /mnt/glusterfs/test3
touch /mnt/glusterfs/test4
touch /mnt/glusterfs/test5
touch /mnt/glusterfs/test6이제 server1.example.com, server2.example.com, server3.example.com, server4.example.com의 /data/export 디렉토리를 확인해 보겠습니다. 각 저장소 노드가 클라이언트의 GlusterFS 공유를 구성하는 파일/디렉토리의 일부만 보유하고 있음을 알 수 있습니다:
server1.example.com:
ls -l /data/export[root@server1 ~]# ls -l /data/export
total 0
-rw-r--r-- 1 root root 0 2010-02-22 20:15 test1
-rw-r--r-- 1 root root 0 2010-02-22 20:15 test2
-rw-r--r-- 1 root root 0 2010-02-22 20:15 test5
[root@server1 ~]#server2.example.com:
ls -l /data/export[root@server2 ~]# ls -l /data/export
total 0
-rw-r--r-- 1 root root 0 2010-02-22 20:15 test4
[root@server2 ~]#server3.example.com:
ls -l /data/export[root@server3 ~]# ls -l /data/export
total 0
-rw-r--r-- 1 root root 0 2010-02-22 20:15 test6
[root@server3 ~]#server4.example.com:
ls -l /data/export[root@server4 ~]# ls -l /data/export
total 0
-rw-r--r-- 1 root root 0 2010-02-22 20:15 test3
[root@server4 ~]#5 링크
- GlusterFS: http://www.gluster.org/
- Fedora: http://fedoraproject.org/
새 게시물을 받은 편지함에서 받기
스팸은 없습니다. 언제든지 구독 해지 가능합니다.