사용자 도구

사이트 도구


os:debian:drbd

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
os:debian:drbd [2007/09/09 01:09]
222.238.62.148
os:debian:drbd [2007/09/09 01:31] (현재)
222.238.62.148
줄 1: 줄 1:
 ====== Configuring DRBD in a Debian OpenSSI Cluster ====== ====== Configuring DRBD in a Debian OpenSSI Cluster ======
  
-===== Overview About DRBD(The Distributed Replicated Block Device) =====+===== Overview About DRBD ===== 
 +  - DRBD is The Distributed Replicated Block Device.
  
 ===== 요구사항(Requirements) ===== ===== 요구사항(Requirements) =====
줄 14: 줄 15:
 fs-cluster 10.0.0.30 fs-cluster 10.0.0.30
 </code> </code>
 +
  
 ===== 과정(Procedure) ===== ===== 과정(Procedure) =====
  
 +==== DRBD 모듈설치 ====
 +  - 양쪽 장비(both hosts) 모두 컴파일하고, 설치한다.<code>
 +# apt-get install drbd0.7-module-source
 +# apt-get install drbd0.7-utils
 +# apt-get install dpatch
 +# cd /usr/src
 +# tar -zxf drbd0.7.tar.gz
 +# cd /usr/src/modules/drbd
 +# module-assistant prepare
 +# module-assistant automatic-install drbd0.7-module-source
 +   Navigate the module package creation procedure as logically as
 +   possible; details for this procedure are not provided.
 +# cd /usr/src
 +# dpkg -i drbd0.7-module-2.4.27-2-k7_0.7.10-3+2.4.27-8_i386.deb
 +</code>
  
 +==== DRBD 구성 ====
 +  - 양쪽 장비에 /etc/drbd.conf 파일에 동일하게 구성한다. <code>
 +resource drbd-resource-0 {
 +  protocol C;
 +  incon-degr-cmd "halt -f"; # killall heartbeat would be a good alternative :->
 +  disk {
 +    on-io-error panic;
 +  }
 +  syncer {
 +    rate 10M; # Note: 'M' is MegaBytes, not MegaBits
 +  }
 +  on host-a {
 +    device    /dev/drbd0;
 +    disk      /dev/hda8;
 +    address   10.0.0.10:7789;
 +    meta-disk  internal;
 +  }
 +  on host-b {
 +    device    /dev/drbd0;
 +    disk      /dev/hda8;
 +    address   10.0.0.20:7789;
 +    meta-disk  internal;
 +  }
 +}
 +</code>
 +  - 양쪽장비에서 DRBD를 실행한다. <code>
 +# /etc/init.d/drbd start
 +</code>
 +  - 장비 중 하나를 Primary 로 선언한다.<code>
 +host-a: # drbdadm primary all
 +</code>
 +  - DRBD 지정한다.<code>
 +host-a: # drbdsetup /dev/drbd0 primary --do-what-I-say
 +</code>
 +  - Primary 장비에서 DRBD를 위한 파일시스템을 활성화시킨다.<code>
 +host-a: # mkreiserfs /dev/drbd0  (or mke2fs, or whatever filesystem you
 +prefer)
 +host-a: # mkdir /share
 +host-a: # mkdir /share/spool0
 +host-a: # mount /dev/drbd0 /share/spool0
 +</code> 
 +  - Primary 장비에서 NFS 아래의 공유디렉토리를 생성한다.<code>
 +host-a: # mkdir /share/spool0/data
 +</code>
 +  - 양쪽노드에 NFS 설정을 한다.
 +    - Debian 패키지를 설치한다.<code>
 +# apt-get install nfs-kernel-server
 +</code>
 +    - NFS 서버를 정지시킨다.<code>
 +# /etc/init.d/nfs-kernel-server stop
 +</code>
 +    - /etc/exports 파일을 설정한다. <code>
 +# echo "/share/spool0/data 10.3.11.0/255.255.255.0(rw,sync)" >> /etc/exports
 +</code>
 +    - 양쪽장비의 NFS 서비스를 자동으로 실행되지 않게 한다.<code>
 +# update-rc.d -f nfs-kernel-server remove
 +(for non-Debian systems you can probably just delete /etc/init.d/
 +nfs or /etc/init.d/nfs-server)
 +</code>
 +    - Primary 장비에서 nfs 설정을 공유디스크에 카피하고, 링크시킨다.<code>
 +host-a: # mv /var/lib/nfs /share/spool0/varlibnfs
 +host-a: # ln -s /share/spool0/varlibnfs /var/lib/nfs
 +</code>
 +    - /etc/default/nfs-common 파일설정을 한다.<code>
 +# vi /etc/default/nfs-common
 +...
 +'STATDOPTS="-n my_clusters_name"
 +...
 +</code>
 +
 +==== heartbeat 설정 ====
 +  - 패키지를 설치한다.<code>
 +# apt-get install heartbeat
 +</code>
 +  - 양쪽 장비의 /etc/ha.d/ha.cf 를 설정한다. \\ 아래는 Primary 장비의 설정이다. \\ 장비별로 ucast는 다르다. \\ node-b는 10.0.0.20 대신 ucast eth0 10.0.0.10 설정한다. <code>
 +keepalive 1
 +deadtime 10
 +warntime 5
 +initdead 60
 +udpport 694
 +baud 19200
 +serial /dev/ttyS0
 +ucast eth0 10.0.0.20
 +auto_failback off
 +watchdog /dev/watchdog
 +node node-a
 +node node-b
 +</code>
 +    * auto_failback is off; we should not fail back unless a human has confirmed that the DRBD state is consistent
 +  - heartbeat resource 생성한다.<code>
 +# echo 'killall -9 nfsd ; exit 0' > /etc/heartbeat/resource.d/killnfsd
 +# chmod 755 /etc/heartbeat/resource.d/killnfsd
 +</code>
 +  - /etc/heartbeat/haresources 에 Primary 장비에 설정한다. <code>
 +host-a  drbddisk::drbd-resource-0 \
 +        Filesystem::/dev/drbd0::/share/spool0/data::reiserfs \
 +        killnfsd \
 +        nfs-common \
 +        nfs-kernel-server \
 +        Delay::3::0 \
 +        IPaddr::10.0.0.30/24/eth0
 +</code>
 +  - HA 서버로부터 마운트시킨다.<code>
 +client-a: # mkdir /mnt/hafs
 +client-a: # echo "fs-cluster:/share/spool0/data /mnt/hafs nfs defaults 0 0" >> /etc/fstab
 +client-a: # mount -a
 +</code>
  
 +===== References =====
 +  - http://www.linux-ha.org/DRBD/NFS
os/debian/drbd.1189267794.txt.gz · 마지막으로 수정됨: 2007/09/09 01:09 저자 222.238.62.148