Install the headers from the newly generated kernel package.
Download the source for the version of DRBD you’re using.
Build the module:
make KDIR=/usr/src/linux-source-2.6.32.46-xen
make install
The configuration files I used for DRBD:
root@cnc:/etc/drbd.d# cat res0.res
resource r0 {
protocol C;
net {
cram-hmac-alg sha1;
shared-secret "FooFunFactory";
}
on cnc {
device drbd0;
disk /dev/cnc/centos;
address 172.16.1.15:7789;
flexible-meta-disk /dev/cnc/centos-drbd;
}
on remote {
device drbd0;
disk /dev/sysvg/instance13193-disk;
address 172.16.1.99:7789;
flexible-meta-disk /dev/sysvg/instance13193-disk-drbd;
}
}
root@cnc:/etc/drbd.d# cat res1.res
resource r1 {
net {
cram-hmac-alg sha1;
shared-secret FooFunFactory2;
}
on cnc {
device drbd1;
disk /dev/cnc/centos-swap;
address 172.16.1.15:7790;
flexible-meta-disk /dev/cnc/centos-swap-drbd;
}
on remote {
device drbd1;
disk /dev/sysvg/instance13193-swap;
address 172.16.1.99:7790;
flexible-meta-disk /dev/sysvg/instance13193-swap-drbd;
}
}
Create metadata:
root@cnc:/etc/drbd.d# drbdadm create-md r0
Writing meta data...
initializing activity log
NOT initialized bitmap
New drbd meta data block successfully created.
success
root@cnc:/etc/drbd.d# drbdadm create-md r1
Writing meta data...
initializing activity log
NOT initialized bitmap
New drbd meta data block successfully created.
success
Attach DRBD to real disk:
drbd attach r0
drbd attach r1
Make this the primary node:
root@cnc:/etc/drbd.d# cat /proc/drbd
version: 8.3.9 (api:88/proto:86-95)
GIT-hash: 1c3b2f71137171c1236b497969734da43b5bec90 build by [email protected], 2011-10-10 00:49:36
0: cs:WFConnection ro:Secondary/Unknown ds:Inconsistent/DUnknown C r----s
ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:10485760
1: cs:WFConnection ro:Secondary/Unknown ds:Inconsistent/DUnknown C r----s
ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:2097152
root@cnc:/etc/drbd.d# drbdadm -- --overwrite-data-of-peer primary r0
root@cnc:/etc/drbd.d# drbdadm -- --overwrite-data-of-peer primary r1
root@cnc:/etc/drbd.d# cat /proc/drbd
version: 8.3.9 (api:88/proto:86-95)
GIT-hash: 1c3b2f71137171c1236b497969734da43b5bec90 build by [email protected], 2011-10-10 00:49:36
0: cs:WFConnection ro:Primary/Unknown ds:UpToDate/DUnknown C r----s
ns:0 nr:0 dw:0 dr:200 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:10485760
1: cs:WFConnection ro:Primary/Unknown ds:UpToDate/DUnknown C r----s
ns:0 nr:0 dw:0 dr:200 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:2097152
Update the configuration:
drbdadm adjust r0
drbdadm adjust r1
Wait until the data is UpToDate
on both sides.
Once it’s uptodate you do a live migration.
Comments