This site best when viewed with a modern standards-compliant browser. We recommend Firefox Get Firefox!.

Linux-HA project logo
Providing Open Source High-Availability Software for Linux and other OSes since 1999.

USA Flag UK Flag

Japanese Flag

Homepage

About Us

Contact Us

Legal Info

How To Contribute

Security Issues

This web page is no longer maintained. Information presented here exists only to avoid breaking historical links.
The Project stays maintained, and lives on: see the Linux-HA Reference Documentation.
To get rid of this notice, you may want to browse the old wiki instead.

1 February 2010 Hearbeat 3.0.2 released see the Release Notes

18 January 2009 Pacemaker 1.0.7 released see the Release Notes

16 November 2009 LINBIT new Heartbeat Steward see the Announcement

Last site update:
2018-06-21 13:51:03

DRBD (and Linux-HA) with RedHat Advanced Server 3.0

Contents

  1. DRBD (and Linux-HA) with RedHat Advanced Server 3.0
    1. Linux-HA Software Packaging
      1. Software Building
      2. Package Building
    2. DRBD Software Packaging
      1. Software Building
      2. Package Source by TWW cross-platform application management tool
      3. Package building
    3. Quality Assurance

Linux-HA Software Packaging

Software Building

Package Building

DRBD Software Packaging

Software Building

  • Compiling DRBD with "sb  drbd-0.6.12/drbd-0.6.12.sb" command The following actions will happen:

    1. grab the source tar ball
    2. unpack it
    3. patch it if need to
    4. configure it
    5. build/compile it

bash-2.05b# sb   drbd-0.6.12.sb
<snip>
gcc -D__KERNEL__ -I/usr/src/linux-2.4.21-9.EL/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common  -Wno-unused -fomit-frame-pointer -pipe -freorder-blocks -mpreferred-stack-boundary=2 -march=i686 -DMODULE -DMODVERSIONS -include /usr/src/linux-2.4.21-9.EL/include/linux/modversions.h  -nostdinc -iwithprefix include -DKBUILD_BASENAME=drbd_syncer  -c -o drbd_syncer.o drbd_syncer.c
gcc -D__KERNEL__ -I/usr/src/linux-2.4.21-9.EL/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common  -Wno-unused -fomit-frame-pointer -pipe -freorder-blocks -mpreferred-stack-boundary=2 -march=i686 -DMODULE -DMODVERSIONS -include /usr/src/linux-2.4.21-9.EL/include/linux/modversions.h  -nostdinc -iwithprefix include -DKBUILD_BASENAME=drbd_req_2.4  -c -o drbd_req-2.4.o drbd_req-2.4.c
echo 2.4.21-9.ELsmp > .kernelrelease
ld -m elf_i386 -r -o drbd.o drbd_fs.o drbd_main.o drbd_proc.o drbd_receiver.o drbd_syncer.o drbd_req-2.4.o
make[3]: Leaving directory `/opt/build/drbd-0.6.12/drbd'
make[2]: Leaving directory `/usr/src/linux-2.4.21-9.EL'
Memorizing module configuration ... done.
make[1]: Leaving directory `/opt/build/drbd-0.6.12/drbd'

        Build successful.
    updating database entry with "default" module ... done
bash-2.05b#

  1. install it into installation directory
  2. Install the drbd kernel modules with "sb -i drbd-0.6.12/drbd-0.6.12.sb" command

bash-2.05b# sb  -i  drbd-0.6.12.sb
drbd-0.6.12
  searching for depot containing "default" module ... found
    depot: file:///pub/twwsrc/drbd-0.6.12
  checking if program exists in local depot ... yes
  reading database entries in /opt/TWWfsw ... done
  syntax checks ...
    checking for build directory ... ok
    checking for build name ... ok
    checking for install name ... ok
    checking if sources specified ... ok
  installation prefix ... /opt/TWWfsw/drbd
  build prefix ... /opt/build/drbd-0.6.12
  installing ...
    creating install script ... /tmp/filessRCfw
    executing install script ...
make[1]: Entering directory `/opt/build/drbd-0.6.12/user'
install -D -m 755 drbdsetup /sbin/drbdsetup
make[1]: Leaving directory `/opt/build/drbd-0.6.12/user'
make[1]: Entering directory `/opt/build/drbd-0.6.12/documentation'
install -D -m 644 drbd.conf.5 /usr/share/man/man5/drbd.conf.5
install -D -m 644 drbd.8      /usr/share/man/man8/drbd.8
install -D -m 644 datadisk.8  /usr/share/man/man8/datadisk.8
install -D -m 644 drbdsetup.8 /usr/share/man/man8/drbdsetup.8
make[2]: Entering directory `/opt/build/drbd-0.6.12/documentation/ja'
install -D -m 644 drbdsetup.8 /usr/share/man/ja/man8/drbdsetup.8
install -D -m 644 drbd.conf.5 /usr/share/man/ja/man5/drbd.conf.5
install -D -m 644 drbd.8 /usr/share/man/ja/man8/drbd.8
install -D -m 644 datadisk.8 /usr/share/man/ja/man8/datadisk.8
make[2]: Leaving directory `/opt/build/drbd-0.6.12/documentation/ja'
make[2]: Entering directory `/opt/build/drbd-0.6.12/documentation/pt_BR'
install -D -m 644 drbdsetup.8 /usr/share/man/pt_BR/man8/drbdsetup.8
install -D -m 644 drbd.conf.5 /usr/share/man/pt_BR/man5/drbd.conf.5
install -D -m 644 drbd.8 /usr/share/man/pt_BR/man8/drbd.8
install -D -m 644 datadisk.8 /usr/share/man/pt_BR/man8/datadisk.8
make[2]: Leaving directory `/opt/build/drbd-0.6.12/documentation/pt_BR'
make[1]: Leaving directory `/opt/build/drbd-0.6.12/documentation'
make[1]: Entering directory `/opt/build/drbd-0.6.12/scripts'
mkdir -p /etc/ha.d/resource.d
install -D -m 755 drbd /etc/rc.d/init.d//drbd
ln -sf ../../../etc/rc.d/init.d/drbd /etc/ha.d/resource.d/datadisk

Don't forget to run update-rc.d or chkconfig
make[1]: Leaving directory `/opt/build/drbd-0.6.12/scripts'
make[1]: Entering directory `/opt/build/drbd-0.6.12/benchmark'
make[1]: Nothing to be done for `install'.
make[1]: Leaving directory `/opt/build/drbd-0.6.12/benchmark'
make[1]: Entering directory `/opt/build/drbd-0.6.12/drbd'
test -n "2.4.21-9.ELsmp"
install -D -m 644 drbd.o "/lib/modules/2.4.21-9.ELsmp/kernel/drivers/block/drbd.o"
install -d -m 700 "/var/lib/drbd"
/sbin/depmod -a || /sbin/depmod -e drbd.o 2>&1 >/dev/null || true
make[1]: Leaving directory `/opt/build/drbd-0.6.12/drbd'
    adding database entry for "default" module ... done
bash-2.05b#

  • Testing

bash-2.05b# sb --force  -t  drbd-0.6.12.sb
drbd-0.6.12
  searching for depot containing "default" module ... found
    depot: file:///pub/twwsrc/drbd-0.6.12
  checking if program exists in local depot ... yes
  reading database entries in /opt/TWWfsw ... done
  syntax checks ...
    checking for build directory ... ok
    checking for build name ... ok
    checking for install name ... ok
    checking if sources specified ... ok
  installation prefix ... /opt/TWWfsw/drbd
  build prefix ... /opt/build/drbd-0.6.12
  testing ...
    creating test script ... /tmp/fileEVjcKY
    executing test script ...
+ ls -l /lib/modules/2.4.21-9.ELsmp/kernel/drivers/block/drbd.o
-rw-r--r--    1 root     root        63353 Mar  8 08:51 /lib/modules/2.4.21-9.ELsmp/kernel/drivers/block/drbd.o
+ insmod drbd
Using /lib/modules/2.4.21-9.ELsmp/kernel/drivers/block/drbd.o
+ lsmod
+ grep drbd
drbd                   50252   0  (unused)
+ rmmod drbd
    updating database entry with "default" module ... done
bash-2.05b#

Package Source by TWW cross-platform application management tool

  • drbd-0.6.12.sb software build automation in xml file format.

bash-2.05b# cat drbd-0.6.12.sb
<?xml version="1.0"?>
<programs>
  <program name="drbd" version="0.6.12" revision="1">
    <module name="default">
      <build-name>${NAME}-${VER}</build-name>
      <install-name>${NAME}</install-name>
      <sources>
        <source path="src/drbd-0.6.12.tar.gz"/>
      </sources>
      <dependencies>
      </dependencies>
      <script-header>
      <![CDATA[
      _doc="${INSTALL_PREFIX}/doc" 
      _sysconfdir="/etc${INSTALL_PREFIX}"
      _localstatedir="/var${INSTALL_PREFIX}"
      ]]>
      </script-header>
<configure>
  <![CDATA[
  case "${SYSTYPE}" in
  *-linux*)
  CC_LD_RT="-Wl,-rpath," STATE_DIR="/var${INSTALL_PREFIX}"
*-solaris2.[89])
  CC=cc CFLAGS="-mr -Qn -xstrconst -xO2 -xtarget=generic -xarch=v8"
  CC_LD_RT="-R" STATE_DIR="/var${INSTALL_PREFIX}"
*-solaris2*)
  CC=cc CFLAGS="-mr -Qn -xstrconst -xO2 -xtarget=generic"
  CC_LD_RT="-R" STATE_DIR="/var${INSTALL_PREFIX}"
esac
#
#http://www.redhat.com/docs/manuals/linux/RHL-9-Manual/custom-guide/s1-custom-kernel-modularized.html
#
cd /usr/src/linux-2.4;make mrproper;make  menuconfig;make dep
perl -pi -e 's!-9\.ELcustom!-9.ELsmp!' Makefile
#sb -i --builddir=/usr/src /pub/twwsrc/drbd-0.6.12/drbd-0.6.12.sb
]]>
      </configure>
     <build>
     #cd drbd ;  make clean all
     perl -pi -e 's!//#define SIGHAND_HACK!#define SIGHAND_HACK!' drbd_config.h
     make clean all
     </build>
<test>
# This test is after install
set -x
ls -l /lib/modules/2.4.21-9.ELsmp/kernel/drivers/block/drbd.o
insmod drbd
lsmod |grep drbd
rmmod drbd
</test>

     <install>

     <![CDATA[
     make install
     ]]>
      </install>
    </module>
  </program>
</programs>
bash-2.05b#

Package building

The DRBD package is hard because it needs to be compiled as kernel modules.

TBA.

Quality Assurance

  • Show me it is working.
  • Show me it is working 100 times.
  • Show me it is working in 100 different cases.