host1 ip: 10.0.10.201
host2 ip: 10.0.10.202
Check if drbd module is available
modprobe -l | grep drbdCheck if drbd module is loaded
lsmod | grep drbdIf not, load it with
modprobe -v drbdCheck the module version
modinfo drbd | grep versionI installed the appropriate drbd8-utils package on both nodes
dpkg -i drbd8-utils_8.3.10-0_amd64.debI built my own deb from source. You can find my build here.
I shrank the data volume on both of
I made use of the extents I freed up by shrinking the data volume to create an lvm volume that will be used for drbd.
lvcreate --verbose --extents 50000 --name lv4drbd pveNext I modified /etc/drbd.d/global_common.conf so that it only contains:
global {
usage-count no;
}
common {
protocol C;
syncer {
rate 30M;
}
}
Next I created a new resouce file /etc/drbd.d/drbd0.resresource drbd0 {
protocol C;
startup {
wfc-timeout 0;
degr-wfc-timeout 60;
become-primary-on both;
}
net {
cram-hmac-alg sha1;
shared-secret "drbd0-secret";
allow-two-primaries;
after-sb-0pri discard-zero-changes;
after-sb-1pri discard-secondary;
after-sb-2pri disconnect;
}
on host1 {
device /dev/drbd0;
disk /dev/pve/lv4drbd;
address 10.0.10.201:7780;
meta-disk internal;
}
on host2 {
device /dev/drbd0;
disk /dev/pve/lv4drbd;
address 10.0.10.202:7780;
meta-disk internal;
}
}
I added the IP address of the other host into each of the /etc/hosts files.Next I started drbd on both nodes with
/etc/init.d/drbd startI then initialized drbd metatdata on both nodes with
drbdadm create-md drbd0Next I brought up the device on both nodes with
drbdadm up drbd0I checked the status on both nodes with
drbd-overviewNext I started synchronization(should be instantaneous) from one node with
drbdadm -- --clear-bitmap new-current-uuid drbd0Lastly, I restarted the drbd service on both nodes to enable Primary/Primary operation
/etc/init.d/drbd stop /etc/init.d/drbd start
I hope you found the post useful. You can subscribe via email or subscribe via a feed reader to get relevant updates from this blog. Have a nice day.
No comments:
Post a Comment