Announcing Heartbeat for FreeBSD (tummy.com, ltd. Journal Entry)
tummy.com: we do linux

Thursday March 24, 2005 at 18:27
Subject: Announcing Heartbeat for FreeBSD
Keywords: Clustering, FreeBSD, Heartbeat, Linux-ha, Technical
Posted by: Scott Kleihege

Related entries:
   Heartbeat/Linux-HA Success Story: tummy.com Routers by Sean Reifschneider, Thursday December 16, 2004 at 15:57
   State of the Traffic Shaping Address by Sean Reifschneider, Wednesday December 22, 2004 at 21:59
   More on the state of shaping. by Sean Reifschneider, Friday December 24, 2004 at 17:12

I'm proud to announce that I've built a FreeBSD port of heartbeat that I hope will soon be included in the official ports repository.

Sean has previously discussed the benefits of FreeBSD's ipfw for traffic shaping, and the benefits of Linux-ha for high availability clusters (see links above). Up until recently, it was possible, but time-consuming to combine the two. The difficulties with Linux-ha's heartbeat clustering software on FreeBSD systems were mostly due to difficulties resolving the package dependencies and problems with configure arguments missing from the normal installation method.

The standard way to configure heartbeat is using the included "ConfigureMe" script. However, due to the oldness of the libnet port on FreeBSD, the standard build method fails with fatal warning messages. It is necessary to use the --disable-fatal-warnings option to the "configure" script in addition to those normally set by ConfigureMe. Below is a list of required ports that I've been able to successfully build heartbeat with.

  • autoconf-2.59_2
  • automake-1.9.5
  • gmake-3.80_2
  • libnet-devel-1.1.2.1
  • libtool-1.5.10_1
  • perl-5.8.6_2

When I initially tested the port I encountered some additional finickiness with the FreeBSD configuration files compared to those used in Linux. The difference is due to the SO_BINDTODEVICE macro not being defined during the build on FreeBSD. This macro allows the socket to be bound to a particular interface on Linux systems, allowing it to distinguish between addresses that need to be receive heartbeat packets, from those that exist on the local system and should be ignored. The upshot is that on Linux systems, the ha.cf file can use multiple ucast lines and therefore be identical on both nodes of the cluster, but FreeBSD needs to have exactly one ucast line.


(Post Reply)
Comment
Author: Wu Shuhua(chinese)
Subject: help me,Scott Kleihege
i am very excited when i saw your message.i want to use heartbeat on freebsd for my graduation thesis,but i've been stranded at the problem(how to build heartbeat on freebsd.) for 1 weeks.i hope you can help me ,expect that you can instruct me the particular method and steps.thanks a lot ,sir.
Comment
Author: Scott Kleihege
Subject: RE: help me,Scott Kleihege

Until the port has been submitted and is included in the ports collection, you can download it here.

To install it, log on as root, then do the following steps:

mkdir /usr/ports/sysutils/heartbeat
cd /usr/ports/sysutils/heartbeat
tar xzpf heartbeat-1.2.3-freebsd-port.tar.gz
make install
make clean
Comment
Author: wsha-xjtu
Subject: thanks for your help,Scott Kleihege
i've install the heartbeat on FreeBSD by following your instructions,thank u very much .now i am studying heartbeat's usage and theory,now i works heartbeat on fedora2,however,it's just underway. anyhow i will be clear about it.i hope i can obtain your assistance in future.
Comment
Robert Gridley
Subject: HA with FreeBSD
Hi,

first of all thank you for your HA-Packet. I installed it on a freebsd 5.4 machine and after restart Heartbeat cant find the Network-Card(Magic-Number failure). Do you have some advice for me, please?

Greetings from Germany,

Robert Gridley

Comment
Author: Scott Kleihege
Subject: Re: HA with FreeBSD
Hello Robert,

first of all thank you for your HA-Packet.

I'm glad to see it getting use all over the world. I recently aquired some systems to use for testing and development and will soon start working on the port for the 2.0 branch.

I installed it on a freebsd 5.4 machine and after restart Heartbeat cant find the Network-Card(Magic-Number failure).

I am aware of an issue where heartbeat may not assign an IP address to the interface you are expecting. An interface needs to have an IP from the same subnet as the address that you are trying to aquire, or it will be assigned to the interface with the default gateway.

As far as I know, magic numbers are included in files and help identify the type of file, much like file extensions. I don't know how they relate to network cards.

Can you provide more details about what ethernet devices you are using, some of your configuration that could be related to the problem, and any error messages you are seeing?

You may also want to ask your question on the Linux-HA mailing list. Many of the developers read the list and are pretty quick to respond to questions. If you're haven't done much posting to mailling lists, Evelyn gave a nice presentation about How to Ask Good Questions. Eric S. Raymond has also written a "How to" that's available in English and German (among others).

Have fun,
Scott

Comment
Robert Gridley
Subject: HA with FreeBSD - it works now
Hi,

i finally got it :) It works :) Thank you very much. I made a HOW TO in German to install LVS and Heartbeat 1.2.3 (from your discription) on FreeBSD 5.4. If you want my HOWTO in German, i will send you it in a Word-Document. I would be happy if i could help you in this way.

Greetings, Robert Gridley