2nodes GFS + DRBD + GNBD(for Fence)

GFS + DRBD(v8) + GNBD(Server for Fence device) on Cluster (2 Nodes)

1. Kernel 및 DRBD 설치

– Kernel

# rpm -ivh kernel-2.6.9-42.0.2.EL.src.rpm

# cd /usr/src/redhat/SPECS

# rpmbuild -bp –target=x86_64 kernel-2.6.spec

# ln -s /usr/src/redhat/BUILD/kernel-2.6.9/linux-2.6.9 /usr/src/linux

– DRBD

# tar xvfz drbd-0.8.1.tar.gz -C /usr/src

# cd /usr/src/drbd-0.8.1

# make clean all

# /lib/modules/`uname -r`/build

  -bash: /lib/modules/2.6.9-55.EL/build: is a directory    [ 이런 메세지가 나와야 정상..]

# cd /usr/src/drbd-0.8.1

# make tools

# make install (인스톨시작)

# make install-tools

# modprobe drbd

# lsmod | grep drbd

   drbd                  222948  0

2. DRBD Configuration

# fdisk /dev/sdb

– /dev/sdb1   800M

– /dev/sdb2   1024M

# vi /etc/drbd.conf

resource RSC {

  protocol C;

  startup {

    wfc-timeout         0;  ## Infinite!

    degr-wfc-timeout   60;  ## 2 minutes.

  }

  disk {

    on-io-error detach;

  }

  net {

    # timeout           60;

    # connect-int       10;

    # ping-int          10;

    # max-buffers     2048;

    # max-epoch-size  2048;

    allow-two-primaries;

  }

  syncer {

    rate   60M;

#   group   0;

    al-extents 257;

  }

  on Node1 {

    device      /dev/drbd0;

    disk        /dev/sdb2;

    address     210.220.224.151:7789;

    meta-disk   /dev/sdb1[0];

  }

  on Node2 {

    device     /dev/drbd0;

    disk       /dev/sdb2;

    address    210.220.224.152:7789;

    meta-disk  /dev/sdb1[0];

  }

}

//각각의 노드에서 동일하게 수행

# drbdadm -d adjust

# drbdadm create-md RSC

… yes

# drbdadm adjust RSC

# service drbd start

# drbdsetup /dev/drbd0 primary -o

3. Cluster Configuration

# service ccsd start

# service cman start

# service fenced start

# service rgmanager start

# vi /etc/init.d/cluster

———————————————————–

#!/bin/sh

. /etc/init.d/functions

case $1 in

  start)

        service ccsd start

        service cman start

        service fenced start

        service gfs start

        service rgmanager start

        ;;

  stop)

        service rgmanager stop

        sleep 1

        service gfs stop

        service rgmanager stop

        service fenced stop

        service cman stop

        service ccsd stop

        ;;

  *)

        echo $”Usage: $0 {start|stop}”

        exit 1

esac

exit 0

———————————————————–

# chmod +x /etc/init.d/cluster

4. GNBD Server Configuration

# gnbd_serv -v

succeeded

# gnbd_export -v -e gnbd0 -d /dev/drbd0

gnbd_clusterd: connected

gnbd_export: created GNBD gnbd0 serving file /dev/drbd0

# modprobe gnbd

# gnbd_import -v -i Node1

gnbd_import: created directory /dev/gnbd

gnbd_import: created gnbd device gnbd0

gnbd_monitor: gnbd_monitor started. Monitoring device #0

gnbd_recvd: gnbd_recvd started

# gfs_mkfs -p lock_dlm -t new_cluster:GNBD -j 3 /dev/gnbd/gnbd0

Are you sure you want to proceed? [y/n] y

Device:                    /dev/gnbd/gnbd0

Blocksize:                 4096

Filesystem Size:           152664

Journals:                  3

Resource Groups:           8

Locking Protocol:          lock_dlm

Lock Table:                new_cluster:GNBD

Syncing…

All Done

// # gnbd_export -R

// # gnbd_import -R   : Import된 자원부터 삭제하고나서 Export한 자원을 삭제해야 한다

서진우

슈퍼컴퓨팅 전문 기업 클루닉스/ 상무(기술이사)/ 정보시스템감리사/ 시스존 블로그 운영자

You may also like...

페이스북/트위트/구글 계정으로 댓글 가능합니다.