Editing HA cluster with DRBD and Heartbeat

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 10: Line 10:
  
  
== Prerequisites ==
+
3wMokG  <a href="http://xbjrbmuwoktf.com/">xbjrbmuwoktf</a>, [url=http://bxxlefalafkt.com/]bxxlefalafkt[/url], [link=http://zvxbehoiawye.com/]zvxbehoiawye[/link], http://djtxdwzhtuou.com/
The OpenVZ kernel already includes the DRBD module. The DRBD userspace tools and the cluster manager Heartbeat must be provided seperately. As the API version of the DRBD userspace tools must exactly match the API version of the module, compile them yourself. Also compile Heartbeat yourself, as at the time of this writing the CentOS extras repository only contained an old CVS version of Heartbeat.
 
 
 
On a hardware node for production use there should not be any application that is not really needed for running OpenVZ (any things which are not needed by OpenVZ should run in a VE for security reasons). As a result, compile DRBD and Heartbeat on another machine running CentOS 4.3 (in this example I used a virtual machine on a VMware Server).
 
 
 
=== Compiling Heartbeat ===
 
Heartbeat version 1.2.* has successfully been used in a lot of two-node-clusters around the world. As the codebase used in version 1.2.* is in production use for many years now, the code is very stable. At the time of writing, Heartbeat version 1.2.4 is the current version of the 1.2.* branch.
 
 
 
Get the tar.gz of the current version of the 1.2.* branch from http://linux-ha.org/download/index.html, at the time of this writing this is http://linux-ha.org/download/heartbeat-1.2.4.tar.gz. Use rpmbuild to build the package:
 
<pre>rpmbuild -ta heartbeat-1.2.4.tar.gz</pre>
 
After that, you find four rpm packes in /usr/src/redhat/RPMS/i386 (heartbeat-1.2.4-1.i386.rpm, heartbeat-ldirectord-1.2.4-1.i386.rpm, heartbeat-pils-1.2.4-1.i386.rpm, heartbeat-stonith-1.2.4-1.i386.rpm). In this example only heartbeat-1.2.4-1.i386.rpm, heartbeat-pils-1.2.4-1.i386.rpm, and heartbeat-stonith-1.2.4-1.i386.rpm are needed.
 
 
 
=== Compiling DRBD userspace tools ===
 
When compiling the DRBD userspace tools, you have to take care to take the version that matches the DRBD version that is included in the OpenVZ kernel you want to use. If you are unsure about the version, do the following steps while running the OpenVZ kernel that you want to use on a test machine (I used another virtual machine on a VMware server to try this):
 
<pre>
 
[root@testmachine ~]# cat /proc/version
 
Linux version 2.6.8-022stab078.10 (root@rhel4-32) (gcc version 3.4.5 20051201 (Red Hat 3.4.5-2)) #1 Wed Jun 21 12:01:20 MSD 2006
 
[root@testmachine ~]# modprobe drbd
 
[root@testmachine ~]# cat /proc/drbd
 
version: 0.7.17 (api:77/proto:74)
 
SVN Revision: 2093 build by phil@mescal, 2006-03-06 15:04:12
 
0: cs:Unconfigured
 
1: cs:Unconfigured
 
[root@testmachine ~]# rmmod drbd
 
[root@testmachine ~]#
 
</pre>
 
Here the version of the DRBD module is 0.7.17. So the userspace tools for 0.7.17 are neccessary.
 
 
 
Back on the buildmachine, do the following to create the rpm:
 
<pre>
 
[root@buildmachine ~]# yum install kernel-devel gcc bison flex
 
Setting up Install Process
 
Setting up repositories
 
Reading repository metadata in from local files
 
Parsing package install arguments
 
Nothing to do
 
[root@buildmachine ~]# tar xfz drbd-0.7.17.tar.gz
 
[root@buildmachine ~]# cd drbd-0.7.17
 
[root@buildmachine drbd-0.7.17]# make rpm
 
[...]
 
You have now:
 
-rw-r--r--  1 root root 288728 Jul 30 10:40 dist/RPMS/i386/drbd-0.7.17-1.i386.rpm
 
-rw-r--r--  1 root root 518369 Jul 30 10:40 dist/RPMS/i386/drbd-km-2.6.9_34.0.2.EL-0.7.17-1.i386.rpm
 
[root@buildmachine drbd-0.7.17]#
 
</pre>
 
Note that in this way the kernel-devel from CentOS is used, but this does not matter as the created drbd-km rpm will not be used (the DRBD kernel module is already included in OpenVZ kernel). If the kernel-devel package is not the same version as the kernel package that is currently running, it is possible to execute 'make rpm KDIR=/usr/src/kernels/2.6.9-34.0.2.EL-i686/' to directly point to the kernel sources.
 
  
 
== Installing the two nodes ==
 
== Installing the two nodes ==

Please note that all contributions to OpenVZ Virtuozzo Containers Wiki may be edited, altered, or removed by other contributors. If you don't want your writing to be edited mercilessly, then don't submit it here.
If you are going to add external links to an article, read the External links policy first!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)