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

CentOS 6.3에서 GlusterFS 3.2.x로 NFS와 유사한 독립형 스토리지 서버 만들기

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

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

1 사전 참고

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

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

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

vi /etc/hosts

| 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 192.168.0.100 server1.example.com server1 192.168.0.101 server2.example.com server2 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 |

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

2 추가 리포지토리 활성화

server1/server2:

먼저 소프트웨어 패키지에 대한 GPG 키를 가져옵니다:

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*

그런 다음 두 개의 CentOS 시스템에서 EPEL6 리포지토리를 활성화합니다:

rpm --import https://fedoraproject.org/static/0608B895.txt
cd /tmp  
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm  
rpm -ivh epel-release-6-7.noarch.rpm
yum install yum-priorities

/etc/yum.repos.d/epel.repo를 편집합니다…

vi /etc/yum.repos.d/epel.repo

… 그리고 [epel] 섹션에 priority=10 행을 추가합니다:

| [epel] name=Extra Packages for Enterprise Linux 6 - $basearch #baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch failovermethod=priority enabled=1 priority=10 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 [...] |

3 GlusterFS 서버 설정

server1.example.com:

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

yum install glusterfs-server

Gluster 데몬의 시스템 시작 링크를 생성하고 시작합니다:

chkconfig --levels 235 glusterd on  
/etc/init.d/glusterd start

명령어

glusterfsd --version

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

[root@server1 ~]# glusterfsd --version  
glusterfs 3.2.7 built on Jun 11 2012 13:22:28  
Repository revision: git://git.gluster.com/glusterfs.git  
Copyright (c) 2006-2011 Gluster Inc.   
GlusterFS는 전혀 보증이 없습니다.  
GNU 일반 공공 라이센스의 조건에 따라 GlusterFS의 복사본을 재배포할 수 있습니다.  
[root@server1 ~]#

방화벽을 사용하는 경우, server1.example.com에서 TCP 포트 111, 24007, 24008, 24009-(모든 볼륨의 브릭 수) 가 열려 있는지 확인하십시오.

다음으로 /data 디렉토리에서 localhost(= server1)에 testvol이라는 이름의 공유를 생성합니다(존재하지 않는 경우 생성됨):

gluster volume create testvol server1.example.com:/data
[root@server1 ~]# gluster volume create testvol server1.example.com:/data  
Creation of volume testvol has been successful. Please start the volume to access data.  
[root@server1 ~]#

볼륨을 시작합니다:

gluster volume start testvol

다음 명령어로 볼륨의 상태를 확인할 수 있습니다:

gluster volume info
[root@server1 ~]# gluster volume info
Volume Name: testvol  
Type: Distribute  
Status: Started  
Number of Bricks: 1  
Transport-type: tcp  
Bricks:  
Brick1: server1.example.com:/data  
[root@server1 ~]#

볼륨이 시작되었다고 표시되면 모든 것이 정상입니다. 그렇지 않으면 다시 시작하십시오.

기본적으로 모든 클라이언트가 볼륨에 연결할 수 있습니다. client1.example.com(= 192.168.0.101)만 접근을 허용하려면 다음을 실행하십시오:

gluster volume set testvol auth.allow 192.168.0.101

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

이제 볼륨 정보가 업데이트된 상태를 보여야 합니다:

gluster volume info
[root@server1 ~]# gluster volume info
Volume Name: testvol  
Type: Distribute  
Status: Started  
Number of Bricks: 1  
Transport-type: tcp  
Bricks:  
Brick1: server1.example.com:/data  
Options Reconfigured:  
auth.allow: 192.168.0.101  
[root@server1 ~]#
 

4 GlusterFS 클라이언트 설정

server2.example.com:

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

yum install glusterfs-client

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

mkdir /mnt/glusterfs

그게 전부입니다! 이제 다음 명령어로 GlusterFS 파일 시스템을 /mnt/glusterfs에 마운트할 수 있습니다:

mount.glusterfs server1.example.com:/testvol /mnt/glusterfs

이제…

mount
[root@server2 ~]# mount  
/dev/mapper/vg_client1-LogVol00 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)  
server1.example.com:/testvol on /mnt/glusterfs type fuse.glusterfs (rw,allow_other,default_permissions,max_read=131072)  
[root@server2 ~]#

… 및…

df -h
[root@server2 ~]# df -h  
Filesystem            Size  Used Avail Use% Mounted on  
/dev/mapper/vg_client1-LogVol00  
                      9.7G  1.7G  7.5G  19% /  
tmpfs                 499M     0  499M   0% /dev/shm  
/dev/sda1             504M   39M  440M   9% /boot  
server1.example.com:/testvol  
                      9.7G  1.7G  7.5G  19% /mnt/glusterfs  
[root@server2 ~]#

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

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

vi /etc/fstab

| [...] server1.example.com:/testvol /mnt/glusterfs glusterfs defaults,_netdev 0 0 |

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

reboot

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

df -h

… 및…

mount

5 링크

Share: X/Twitter LinkedIn

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

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