CentOS 7
Sponsored Link

DRBD : Install
2016/01/27
 
Install DRBD (Distributed Replicated Block Device) to configure Distributed Storage System.
This example is based on the environment like follows.
+----------------------+          |          +----------------------+
| [   DRBD Server#1  ] |10.0.0.51 | 10.0.0.52| [   DRBD Server#2  ] |
|   node01.srv.world   +----------+----------+   node02.srv.world   |
|                      |                     |                      |
+----------------------+                     +----------------------+

It's necessarry the server you'd like to install DRBD has free block-device.
This example shows to configure to use a block-device "/dev/vg_r0/lv_r0".
[1] Update system & install required packages first and reboot on both Hosts.
[[email protected] ~]#
yum -y update

[[email protected] ~]#
yum -y install gcc make automake autoconf libxslt libxslt-devel flex rpm-build kernel-devel

[[email protected] ~]#
[2]
Install DRBD on both Hosts.
Make sure the latest DRBD and download it on the site below.
⇒ http://oss.linbit.com/drbd/
By the way, drbd-km package is built with the current version of kernel, so if you will update kernel in the future, then you need to re-build DRBD again with the version of kernel.
[[email protected] ~]#
mkdir -p rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}

[[email protected] ~]#
wget http://oss.linbit.com/drbd/drbd-utils-latest.tar.gz \
http://oss.linbit.com/drbd/8.4/drbd-8.4.7-1.tar.gz
[[email protected] ~]#
tar zxvf drbd-8.4.7-1.tar.gz

[[email protected] ~]#
cd drbd-*

[[email protected] drbd-8.4.7-1]#
make km-rpm

[[email protected] drbd-8.4.7-1]#
[[email protected] ~]#
tar zxvf drbd-utils-latest.tar.gz

[[email protected] ~]#
cd drbd-utils-*

[[email protected] drbd-utils-8.9.5]#
vi drbd.spec.in
# near line 34: add the line

%bcond_without sbinsymlinks
%undefine with_sbinsymlinks
[[email protected] drbd-utils-8.9.5]#
./configure

[[email protected] drbd-utils-8.9.5]#
make rpm

[[email protected] drbd-utils-8.9.5]#
cd /root/rpmbuild/RPMS/x86_64
[[email protected] x86_64]#
rpm -Uvh drbd-utils-*.rpm drbd-km-*.rpm

Preparing...                          ################################# [100%]
Updating / installing...
   1:drbd-utils-8.9.5-1.el7.centos    ################################# [ 33%]
   2:drbd-km-3.10.0_327.4.5.el7.x86_64################################# [ 67%]
   3:drbd-km-debuginfo-8.4.7-1        ################################# [100%]