Header

  1. View current page

    notesphere

Profile_img_60x60_01
0

GFS

Red Hat GFS is ...

  • The first native 64-bit cluster file system on Linux for enterprise workloads - support for x86, AMD64/EM64T, and Itanium
  • The most scalable enterprise cluster file system on Linux - supporting over 100 nodes
  • Tightly integrated with Red Hat Enterprise Linux (tracks kernel releases and is supported for the full lifetime)
  • The first open source (GPL) cluster file system for enterprise workloads
  • Fully POSIX-compliant, meaning applications don't have to be rewritten to use GFS

Red Hat GFS is commonly used in clusters of enterprise applications to provide high speed access to a consistent file system image across the server nodes. This allows the cluster nodes to simultaneously read and write to a single shared filesystem. Typical application clusters where Red Hat GFS is deployed today include:

  • Databases - View the install guide for Oracle RAC
  • Application and web servers
  • In-house custom applications
  • High-performance compute clusters where NFS scalability and performance are key

Red Hat Global File System (GFS) is supported for use with Red Hat Enterprise Linux AS, Red Hat Enterprise Linux WS, and Red Hat Enterprise Linux ES on x86, AMD64/EM64T and Itanium. Like all Red Hat solutions, it is delivered through Red Hat Network on an annual subscription basis.

 

개요

GFS가 구축된 후의 모습은 대략 이렇게 됩니다.

gfs_arch.jpg 

 

Conga를 이용하여 GFS시스템 구축하기

conga는 Redhat에서 제공하는 클러스터링 관리 툴입니다. 클러스터링을 편리하게 구축하고 관리하기위한 다양한 기능들이 내장되어있습니다.  또한 웹 인터페이스를 기본으로 하기 때문에 셸로 접속할 필요없이 언제 어디서든 웹으로 접속하여 편리하고 관리할 수 있습니다.

 

CentOS 5.2부터 패키지형식으로 제공되고 있어 편리하게 설치할 수 있습니다. 패키지를 설치하기 전에 다음의 사항을 미리 생각해보아야 합니다.

  1. conga 프로그램이 설치될 호스트 : GFS를 제공하는 노드와 겸해도 상관없음.
  2. GFS를 구성할 때 디스크를 제공하는 노드
  3. GFS 파티션을 외부로 NFS로 제공할 노드
  4. conga 프로그램과 각 노드가 통신할 포트

 

conga 패키지 설치

먼저 GFS가 설치될 모든 노드에 conga패키지를 설치합니다.

yum install ricci

의존성에 따라 부가적으로 추가로 설치되는 패키지가 있을 수 있으니 같이 설치해줍니다.

  1. [root@localhost ~]# yum install ricci
    Loading "fastestmirror" plugin
    Loading mirror speeds from cached hostfile
     * base: centos.mirror.cdnetworks.com
     * updates: centos.mirror.cdnetworks.com
     * addons: centos.mirror.cdnetworks.com
     * extras: centos.mirror.cdnetworks.com
    Setting up Install Process
    Parsing package install arguments
    Resolving Dependencies
    --> Running transaction check
    ---> Package ricci.i386 0:0.12.0-7.el5.centos.3 set to be updated
    --> Processing Dependency: modcluster >= 0.10.0 for package: ricci
    --> Running transaction check
    ---> Package modcluster.i386 0:0.12.0-7.el5.centos set to be updated
    --> Processing Dependency: libcman.so.2 for package: modcluster
    --> Running transaction check
    ---> Package cman.i386 0:2.0.84-2.el5 set to be updated
    --> Processing Dependency: perl(XML::LibXML) for package: cman
    --> Processing Dependency: openais for package: cman
    --> Processing Dependency: libcpg.so.2(OPENAIS_CPG_1.0) for package: cman
    --> Processing Dependency: libSaCkpt.so.2 for package: cman
    --> Processing Dependency: libSaCkpt.so.2(OPENAIS_CKPT_B.01.01) for package: cman
    --> Processing Dependency: libcpg.so.2 for package: cman
    --> Processing Dependency: perl(Net::Telnet) for package: cman
    --> Running transaction check
    ---> Package openais.i386 0:0.80.3-15.el5 set to be updated
    ---> Package perl-XML-LibXML.i386 0:1.58-5 set to be updated
    --> Processing Dependency: perl(XML::SAX::DocumentLocator) for package: perl-XML-LibXML
    --> Processing Dependency: perl(XML::SAX::Base) for package: perl-XML-LibXML
    --> Processing Dependency: perl-XML-SAX for package: perl-XML-LibXML
    --> Processing Dependency: perl(XML::SAX::Exception) for package: perl-XML-LibXML
    --> Processing Dependency: perl-XML-LibXML-Common for package: perl-XML-LibXML
    --> Processing Dependency: perl(XML::LibXML::Common) for package: perl-XML-LibXML
    --> Processing Dependency: perl(XML::NamespaceSupport) for package: perl-XML-LibXML
    --> Processing Dependency: perl-XML-NamespaceSupport for package: perl-XML-LibXML
    ---> Package perl-Net-Telnet.noarch 0:3.03-5 set to be updated
    --> Running transaction check
    ---> Package perl-XML-NamespaceSupport.noarch 0:1.09-1.2.1 set to be updated
    ---> Package perl-XML-SAX.noarch 0:0.14-5 set to be updated
    ---> Package perl-XML-LibXML-Common.i386 0:0.13-8.2.2 set to be updated
    --> Finished Dependency Resolution
  2. Dependencies Resolved
  3. =============================================================================
     Package                 Arch       Version          Repository        Size
    =============================================================================
    Installing:
     ricci                   i386       0.12.0-7.el5.centos.3  base              1.1 M
    Installing for dependencies:
     cman                    i386       2.0.84-2.el5     base              595 k
     modcluster              i386       0.12.0-7.el5.centos  base              336 k
     openais                 i386       0.80.3-15.el5    base              368 k
     perl-Net-Telnet         noarch     3.03-5           base               56 k
     perl-XML-LibXML         i386       1.58-5           base              231 k
     perl-XML-LibXML-Common  i386       0.13-8.2.2       base               16 k
     perl-XML-NamespaceSupport  noarch     1.09-1.2.1       base               15 k
     perl-XML-SAX            noarch     0.14-5           base               75 k
  4. Transaction Summary
    =============================================================================
    Install      9 Package(s)
    Update       0 Package(s)
    Remove       0 Package(s)
  5. Total download size: 2.7 M
    Is this ok [y/N]: y
    Downloading Packages:
    (1/9): perl-XML-LibXML-Co 100% |=========================|  16 kB    00:00
    (2/9): perl-XML-SAX-0.14- 100% |=========================|  75 kB    00:00
    (3/9): perl-Net-Telnet-3. 100% |=========================|  56 kB    00:00
    (4/9): perl-XML-Namespace 100% |=========================|  15 kB    00:00
    (5/9): ricci-0.12.0-7.el5 100% |=========================| 1.1 MB    00:00
    (6/9): perl-XML-LibXML-1. 100% |=========================| 231 kB    00:00
    (7/9): modcluster-0.12.0- 100% |=========================| 336 kB    00:00
    (8/9): openais-0.80.3-15. 100% |=========================| 368 kB    00:00
    (9/9): cman-2.0.84-2.el5. 100% |=========================| 595 kB    00:00
    Running rpm_check_debug
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing: perl-XML-NamespaceSupport    ######################### [1/9]
      Installing: perl-XML-SAX                 ######################### [2/9]
      Installing: perl-XML-LibXML-Common       ######################### [3/9]
      Installing: perl-XML-LibXML              ######################### [4/9]
    could not find ParserDetails.ini in /usr/lib/perl5/vendor_perl/5.8.8/XML/SAX
      Installing: perl-Net-Telnet              ######################### [5/9]
      Installing: openais                      ######################### [6/9]
      Installing: cman                         ######################### [7/9]
      Installing: modcluster                   ######################### [8/9]
      Installing: ricci                        ######################### [9/9]
  6. Installed: ricci.i386 0:0.12.0-7.el5.centos.3
    Dependency Installed: cman.i386 0:2.0.84-2.el5 modcluster.i386 0:0.12.0-7.el5.centos openais.i386 0:0.80.3-15.el5 perl-Net-Telnet.noarch 0:3.03-5 perl-XML-LibXML.i386 0:1.58-5 perl-XML-LibXML-Common.i386 0:0.13-8.2.2 perl-XML-NamespaceSupport.noarch 0:1.09-1.2.1 perl-XML-SAX.noarch 0:0.14-5
    Complete!
    [root@localhost ~]#

 

  1. [root@localhost ~]# service ricci start
    Starting oddjobd:                                          [  OK  ]
    Starting ricci:                                            [  OK  ]
    [root@localhost ~]#

conga 호스트 컴퓨터에 conga서버 패키지인 luci를 설치합니다.

  1. [root@localhost ~]# yum install luci
    Loading "fastestmirror" plugin
    Loading mirror speeds from cached hostfile
     * base: centos.mirror.cdnetworks.com
     * updates: centos.mirror.cdnetworks.com
     * addons: centos.mirror.cdnetworks.com
     * extras: centos.mirror.cdnetworks.com
    Setting up Install Process
    Parsing package install arguments
    Resolving Dependencies
    --> Running transaction check
    ---> Package luci.i386 0:0.12.0-7.el5.centos.3 set to be updated
    --> Processing Dependency: python-imaging for package: luci
    --> Running transaction check
    ---> Package python-imaging.i386 0:1.1.5-5.el5 set to be updated
    --> Processing Dependency: libtk8.4.so for package: python-imaging
    --> Processing Dependency: tkinter for package: python-imaging
    --> Running transaction check
    ---> Package tkinter.i386 0:2.4.3-21.el5 set to be updated
    --> Processing Dependency: libTix8.4.so for package: tkinter
    ---> Package tk.i386 0:8.4.13-5.el5_1.1 set to be updated
    --> Running transaction check
    ---> Package tix.i386 1:8.4.0-11.fc6 set to be updated
    --> Finished Dependency Resolution
  2. Dependencies Resolved
  3. =============================================================================
     Package                 Arch       Version          Repository        Size
    =============================================================================
    Installing:
     luci                    i386       0.12.0-7.el5.centos.3  base               27 M
    Installing for dependencies:
     python-imaging          i386       1.1.5-5.el5      base              410 k
     tix                     i386       1:8.4.0-11.fc6   base              329 k
     tk                      i386       8.4.13-5.el5_1.1  base              888 k
     tkinter                 i386       2.4.3-21.el5     base              279 k
  4. Transaction Summary
    =============================================================================
    Install      5 Package(s)
    Update       0 Package(s)
    Remove       0 Package(s)
  5. Total download size: 28 M
    Is this ok [y/N]: y
    Downloading Packages:
    (1/5): python-imaging-1.1 100% |=========================| 410 kB    00:00
    (2/5): tk-8.4.13-5.el5_1. 100% |=========================| 888 kB    00:00
    (3/5): tix-8.4.0-11.fc6.i 100% |=========================| 329 kB    00:00
    (4/5): luci-0.12.0-7.el5. 100% |=========================|  27 MB    00:02
    (5/5): tkinter-2.4.3-21.e 100% |=========================| 279 kB    00:00
    Running rpm_check_debug
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing: tk                           ######################### [1/5]
      Installing: tix                          ######################### [2/5]
      Installing: tkinter                      ######################### [3/5]
      Installing: python-imaging               ######################### [4/5]
      Installing: luci                         ######################### [5/5]
  6. Installed: luci.i386 0:0.12.0-7.el5.centos.3
    Dependency Installed: python-imaging.i386 0:1.1.5-5.el5 tix.i386 1:8.4.0-11.fc6 tk.i386 0:8.4.13-5.el5_1.1 tkinter.i386 0:2.4.3-21.el5
    Complete!
    [root@localhost ~]#

의존성에 따라 부가적으로 추가로 설치되는 패키지가 있을 수 있으니 같이 설치해줍니다.

 

이제 luci을 사용하기 위해 초기화를 해야합니다.

  1. [root@localhost ~]# luci_admin init
    Initializing the luci server

  2. Creating the 'admin' user
  3. Enter password:
    Confirm password:
  4. Please wait...
    The admin password has been successfully set.
    Generating SSL certificates...
    The luci server has been successfully initialized

  5. You must restart the luci server for changes to take effect.
  6. Run "service luci restart" to do so
  7. [root@localhost ~]#

관리용 비밀번호를 생성합니다.

모든 작업이 완료되었으면 luci를 재시작합니다.

  1. [root@localhost ~]# service luci restart
    Shutting down luci:                                        [  OK  ]
    Starting luci: Generating https SSL certificates...  done
                                                               [  OK  ]
  2. Point your web browser to https://localhost:8084 to access luci
  3. [root@localhost ~]#

이제 https://hostname:8084/ 주소로 luci에 접속하여 클러스터링은 관리할 수 있습니다.

 

luci를 이용하여 GFS구성

luci를 이용하기 앞서, 아직 luci가 조금 불안한 면을 보인다는 점을 말씀드리고 싶습니다. 설정이 적용이 잘 안되거나, 엉뚱하게 설정되거나 하는 일들이 간혹 발생합니다. 그럴 경우에는 패키지(ricci, luci)를 삭제하시고 /etc/cluster 디렉토리를 삭제 하신 후 다시 패키지 설치부터 다시 진행해보시길 바랍니다.

 

luci 접속

웹 브라우져에 https://hostname:8084 를 입력하면 luci에 접속할 수 있습니다.

luci_login.png 

클러스터 노드 구성

로그인 후 맨 위에 cluster 탭을 선택하고 좌측 Create New Cluster를 선택합니다. 클러스터 시스템을 추가할 수 있는 화면이 나옵니다. 알맞은 내용을 써 넣습니다.

  • Cluster Name : 클러스터 이름
  • Node Hostname : 각 노드의 호스트 이름. 보통 /etc/hosts 에 정의된 이름을 적어주면 되며, 호스트이름은 '.' 문자가 들어가야 제대로 작동함(예 : gfs01.test). IP주소를 적으면 불안한 경향이 있음.
  • Root Password : 각 노드에 접속할 때 사용할 root 비밀번호
  • Add a cluster node : 노드를 입력할 공란을 한개 추가함.
  • Download packages : 추가로 필요한 패키지를 내려받아 사용함.
  • Use locally installed packages. : 이미 설치된 패키지를 사용함.

luci_addnode.png 

Submit를 누르면 클러스터 구성이 자동으로 진행됩니다.

luci_setupnode.png 

설치 과정에 따라 오랜 시간이 걸릴 수 있습니다. 각 단계가 지날 때마다 그래프로 표시가 되며 클러스터 구성이 완료되면 구성한 클러스터 정보 화면을 볼 수 있습니다.

왼쪽 메뉴를 보면 방금 설정한 클러스터가 메뉴에 추가된 것을 볼 수 있습니다. Nodes를 선택하여 현재 노드 상태를 확인해봅니다.

각 노드들의 상태(Status)가 Cluster Member로 되어있으면 구성이 잘 되어 동작하고 있는 상태입니다.

luci_status.png 

현재 상태가 Cluster Member로 되어있지 않은 경우에는,

  1. 오른쪽 Choose a Task...를 눌러 have node join a cluster를 선택하거나
  2. 직접 노드에 접속하여 # service cman restart 를 실행하여 서비스를 재시작해봅니다.

 

luci에 접속하지 않고도 clustat 명령을 사용하여 현재 클러스터 상태를 확인할 수 있습니다.

모두 Online으로 표시되어야 정상입니다.

  1. [root@gs002 ~]# clustat
    Cluster Status for 40-storage @ Thu Oct  2 02:10:51 2008
    Member Status: Quorate
  2.  Member Name                             ID   Status
     ------ ----                             ---- ------
     gs002.gfs                                   1 Online, Local
     grand.gfs                                   2 Online
     ridicule.gfs                                3 Online
  3. [root@gs002 ~]#

 

GFS구성

하나의 큰 스토리지를 구성하여 사용하려면 Logical Volume을 구성하는 것도 좋은 방법입니다.

GFS를 이용하여 각 노드에 있는 원격의 파티션을 끌어와 Logical Volume으로 하나의 큰 파티션을 만들 것입니다.

이 과정에서 GNBD가 필요하게 됩니다. GNBD를 통하여 로컬 노드의 파티션을 외부에 보이고, 원격 노드의 파티션을 가져와 사용할 수 있습니다.

GNBD설치

gnbd관련 패키지를 설치합니다. gnbd프로그램과 커널 모듈을 설치하여야 합니다.

kmod로 시작하는 커널 모듈은 PAE, XEN 등 커널의 종류에 따라 모듈을 다르게 설치하여야 합니다.

  1. [root@localhost ~]# yum install gnbd kmod-gnbd
    Loading "fastestmirror" plugin
    Loading mirror speeds from cached hostfile
     * base: centos.mirror.cdnetworks.com
     * updates: centos.mirror.cdnetworks.com
     * addons: centos.mirror.cdnetworks.com
     * extras: centos.mirror.cdnetworks.com
    Setting up Install Process
    Parsing package install arguments
    Resolving Dependencies
    --> Running transaction check
    ---> Package kmod-gnbd.i686 0:0.1.4-12.el5 set to be installed
    ---> Package gnbd.i386 0:1.1.5-1.el5 set to be updated
    --> Finished Dependency Resolution
  2. Dependencies Resolved
  3. =============================================================================
     Package                 Arch       Version          Repository        Size
    =============================================================================
    Installing:
     gnbd                    i386       1.1.5-1.el5      base               84 k
     kmod-gnbd               i686       0.1.4-12.el5     base               14 k
  4. Transaction Summary
    =============================================================================
    Install      2 Package(s)
    Update       0 Package(s)
    Remove       0 Package(s)
  5. Total download size: 98 k
    Is this ok [y/N]: y
    Downloading Packages:
    (1/2): gnbd-1.1.5-1.el5.i 100% |=========================|  84 kB    00:00
    (2/2): kmod-gnbd-0.1.4-12 100% |=========================|  14 kB    00:00
    Running rpm_check_debug
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing: gnbd                         ######################### [1/2]
      Installing: kmod-gnbd                    ######################### [2/2]
  6. Installed: gnbd.i386 0:1.1.5-1.el5 kmod-gnbd.i686 0:0.1.4-12.el5
    Complete!
    [root@localhost ~]#

GNBD구성

GNBD를 구성하기 전에 GNBD모듈이 로딩되었는지, 클러스터 구성이 제대로 되어있는지 꼭 확인하여야합니다.

GNBD export

GNBD를 이용하여 원하는 장치를 외부로 노출 시킬 수 있습니다.

 

GNBD서버를 시작합니다.

  1. [root@gfs01 ~]# gnbd_serv -v
    gnbd_serv: startup succeeded

 

여기서는 하나의 하드디스크 전체(/dev/sdb)를 통째로 사용하겠습니다. 명령어는 gnbd_export를 사용합니다. 사용되는 옵션은 다음과 같습니다.

  • -d : 외부로 노출할 장치 혹은 디스크 파티션
  • -e : gnbd에서 인식할 장치 이름

 

  1. [root@gfs01 ~]# gnbd_export -d /dev/sdb -e gfs01_sdb -v
    gnbd_clusterd: connected
    gnbd_export: created GNBD gfs01_sdb serving file /dev/sdb

 

다음과 같이 결과를 확인할 수 있습니다.

  1. [root@gfs01 ~]# gnbd_export -l
    Server[1] : gfs01_sdb
    --------------------------
          file : /dev/sdb
       sectors : 209715200
      readonly : no
        cached : no
       timeout : 60
  2. [root@gfs01 ~]#

 

 GFS에 디스크를 제공할 각 노드에서 위의 과정을 모두 적용합니다.

GNBD import

GNBD를 이용하여 외부로 노출한 장치를 가져와서 로컬디스크인 것 처럼 사용합니다.

 

GNBD서버를 시작합니다.

  1. [root@localhost ~]# gnbd_serv -v
    gnbd_serv: startup succeeded

 

gnbd_import 명령을 사용하여 외부의 장치를 가져올 수 있습니다.

  • -i : 가져올 호스트 주소를 적어주면 모든 장치를 가져옴.
  1. [root@ridicule gnbd]# gnbd_import -i grand.gfs
    gnbd_import: created gnbd device grand_sda
    gnbd_monitor: gnbd_monitor started. Monitoring device #0
    gnbd_recvd: gnbd_recvd started
    [root@ridicule gnbd]#

 방금 전 외부로 노출했던 모든 노드들에 대하여 이를 반복합니다.

디렉토리 /dev/gnbd 를 살펴보면 현재 import된 장치를 확인할 수 있습니다.

  1. [root@ridicule gnbd]# ls -al /dev/gnbd/
    total 0
    drwxr-xr-x  2 root root     80 Oct  3 02:09 .
    drwxr-xr-x 13 root root   6040 Oct  3 01:48 ..
    brw-r--r--  1 root root 252, 0 Oct  3 02:09 grand_sda
    brw-r--r--  1 root root 252, 1 Oct  3 02:09 gs002_sda
    [root@ridicule gnbd]#

LVM설정

가져온 장치를 이용하여 LVM을 구성합니다.

장치를 구성하는 순서는 다음과 같습니다.

  1. Physical Volume(pv)
  2. Volume Group(vg)
  3. Logical Volume(lv)

기본적인 명령은 create, remove, display, scan 등이 있으며 [pv/vg/lv]create 등으로 사용하시면 됩니다.

 

각 장치를 모두 pv로 등록합니다.

  1. [root@ridicule /]# pvcreate /dev/gnbd/grand_sda
      Physical volume "/dev/gnbd/grand_sda" successfully created
    [root@ridicule /]# pvcreate /dev/gnbd/grand_sda
      Physical volume "/dev/gnbd/grand_sda" successfully created
    [root@ridicule /]#

pvdisplay 명령으로 확인할 수 있습니다.

  1.  [root@ridicule /]# pvdisplay
      "/dev/gnbd0" is a new physical volume of "3.64 TB"
      --- NEW Physical volume ---
      PV Name               /dev/gnbd0
      VG Name
      PV Size               3.64 TB
      Allocatable           NO
      PE Size (KByte)       0
      Total PE              0
      Free PE               0
      Allocated PE          0
      PV UUID               RbLAwv-FmlE-uMJX-XNVe-SmrR-0vaT-t64FxW
  2.   "/dev/gnbd1" is a new physical volume of "2.73 TB"
      --- NEW Physical volume ---
      PV Name               /dev/gnbd1
      VG Name
      PV Size               2.73 TB
      Allocatable           NO
      PE Size (KByte)       0
      Total PE              0
      Free PE               0
      Allocated PE          0
      PV UUID               cpv9wJ-hOHb-tRUt-RD3C-e2X0-LTap-msLuF7
  3. [root@ridicule /]#

만들어진 pv을 이용해 vg를 만듭니다.

  1. [root@ridicule /]# vgcreate storage /dev/gnbd/gs002_sda /dev/gnbd/grand_sda
      Volume group "storage" successfully created
    [root@ridicule /]#

vgdisplay명령으로 확인할 수 있습니다.

  1. [root@ridicule /]# vgdisplay
      --- Volume group ---
      VG Name               storage
      System ID
      Format                lvm2
      Metadata Areas        2
      Metadata Sequence No  1
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                0
      Open LV               0
      Max PV                0
      Cur PV                2
      Act PV                2
      VG Size               6.37 TB
      PE Size               4.00 MB
      Total PE              1668910
      Alloc PE / Size       0 / 0
      Free  PE / Size       1668910 / 6.37 TB
      VG UUID               Ka8FBa-7Vdr-WusA-OTTz-edJc-bEd4-hZxjEU
  2. [root@ridicule /]#

lvcreate명령을 이용하여 lv를 만듭니다.

  • -L : 용량을 지정
  • -n : lv의 이름을 지정
  1.  [root@ridicule /]# lvcreate -L 6T -n storage01 storage
      Logical volume "storage01" created
    [root@ridicule /]#

 생성된 lv를 최종적으로 GFS2로 포맷합니다.

  1. [root@ridicule /]# mkfs.gfs2 -p lock_dlm -t storage-cluster:storage01 -j 4 /dev/storage/storage01

이를 마운트 하면 모든 과정이 끝나고 사용할 수 있는 상태가 됩니다. 

History

Last edited on 10/06/2008 11:55 by 룬룬

Comments (0)

You must log in to leave a comment. Please sign in.