DRBD, heartbeat on Debian Etch: Difference between revisions

From Skytech
Jump to navigation Jump to search
Line 93: Line 93:
mkfs.ext3 /dev/drbd0
mkfs.ext3 /dev/drbd0
</pre>
</pre>

== Install services ==
<pre>
## Apache + php5 + mysql
apt-get install apache2 php5 php5-mysql

## pureftpd
apt-get install pure-ftpd

Revision as of 21:49, 11 December 2008


DRBD & Heartbeat on Debian Etch

Install DRBD

Unfortunately, drbd is not actively available as a package under Debian Etch, so it has to be build from source.

Luckily this can be done automatically with debian.

apt-get install module-assistant build-essential drbd0.7-module-source

## Then build the module
m-a a-i drbd0.7

Setup some basic drbd replication [internal meta - partition]

resource drbd {
  protocol C;
  incon-degr-cmd "killall heartbeat";
  disk {
    on-io-error panic;
  }
  syncer {
    rate 10M; # Note: 'M' is MegaBytes, not MegaBits
  }
  on server1 {
    device    /dev/drbd0;
    disk      /dev/hdc3;
    address   192.168.0.110:7789;
    meta-disk  internal;
  }
  on server2 {
    device    /dev/drbd0;
    disk      /dev/hda3;
    address   192.168.0.140:7789;
    meta-disk  internal;
  }
}

Of course adjust to your need.


Install heartbeat

apt-get install heartbeat

Setup heartbeat (basic)

Edit both host files ( /etc/ha.d/authkeys )

auth 2
1 crc
2 sha1 ThisIsASampleKeyAnythingAlphaNumericIsGoodHere
3 md5 ThisIsASampleKeyAnythingAlphaNumericIsGoodHere

Edit HA for master node ( /etc/ha.d/ha.cf )

keepalive 1
deadtime 10
warntime 5
initdead 60
udpport 694
baud 19200
serial /dev/ttyS0
ucast eth0 192.168.0.140   (slave node should have master ip here; 192.168.0.110)
auto_failback off
watchdog /dev/watchdog
node node-a
node node-b

Update systemfiles

Add needed servers to hosts file

[ ... ]
192.168.0.110   server1
192.168.0.140   server2
192.168.0.180   server
[ ... ]

chmod /etc/ha.d/authkeys files

chmod 0600 /etc/ha.d/authkeys

Prepare new drbd partition for data

mkfs.ext3 /dev/drbd0

Install services

## Apache + php5 + mysql
apt-get install apache2 php5 php5-mysql

## pureftpd
apt-get install pure-ftpd