apt-get install autoconf build-essential
wget http://remusha.wikidot.com/local--files/configuring-and-installing-remus/drbd-8.3.11-remus.tar.gztar zxvf <span style="font-family: Arial, Helvetica, sans-serif;">drbd-8.3.11-remus.tar.gz</span>
cd ./drbd-8.3.11
./autogen.sh
./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc --with-km
make
make install
cd drbd
make clean all
make install
vi /etc/modules
# add drbd
6. 配置DRBD
cp /home/user/drbd-8.3.11/scripts/global_common.conf.protoD /etc/drbd.d/global_common.conf
cp /home/user/drbd-8.3.11/scripts/testvms_protoD.res /etc/drbd.d/SystemHA_protoD.res
lvcreate -n test -L 10G right
vi /etc/drbd.d/SystemHA_protoD.res
#
resource drbd-vm {
device /dev/drbd1;
disk /dev/right/test;
meta-disk internal;
on left {
address IP地址:端口;
}
on right{
address IP地址:端口;
}
}
#
drbdadm create-md drbd-vm
drbdadm up drbd-vm
root@null:~$ cat /proc/drbd
version: 8.3.9 (api:88/proto:86-95)
GIT-hash: 3ba4fc581d6215744597b3d4c525db276ce000ee build by root@null, 2011-05-14 19:33:56
1: cs:Connected ro:Secondary/Secondary ds:Inconsistent/Inconsistent D r-----
xm create /etc/xen/ubuntu.cfg -c
xm list
# test live migration, if you can't live migrate, then Remus isn't going to work either
xm migrate --live rt right
# try remus ("rt" is the domU, and "right" is the other server, assuming we're running from "left" here)
remus -i 40 rt right
# You should get a whole bunch of these messages:
#
PROF: flushed memory at 1361239602.516625
PROF: suspending at 1361239602.554033
#