[DRBD-user] What server to run services while syncing

Lars Ellenberg Lars.Ellenberg at linbit.com
Wed Jun 21 09:58:34 CEST 2006

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.

/ 2006-06-20 23:11:52 -0700
\ Gary W. Smith:
> Your concept is correct for failover.  Secondary is now primary until
> you make it otherwise.  This is where heartbeat (or linux-ha) comes into
> play.  It is the automation tool.  It will promote the secondary to
> primary for you and fail back automatically (if you so configure it to
> do so) when the proper primary comes back online and is in sync.

see also the "auto_failback" option in ha.cf.
if your hardware is equivalent, you should probably switch it off,
since the services are perfectly happy to run on the non-homenode, too.
which will reduce the overall number of failovers.

> Check out Linux-ha's implementation of DRBD.  It is literally just 3
> lines in a config file to do what you are asking, with auto failover.
> As for the startup and shutdown of virtual servers, HA can do that for
> you as well.  You need only encapsulate your scripts in a init.d
> compatible fashion (that is supporting start/stop).

"start" and "stop" _have_ to be idempotent, that is they must have
exit code 0 (not 1) if you request a start and it is already running,
or if you request a stop and it was not running at all...

and, very important, you need a working "status".
if you don't have that, you will run into trouble.
without working "status", in some situations heartbeat may not start
services at all, or may reboot your box...

"status" must print the string "running" to stdout
if the service is running, and should print "stopped" to stdout
if the service is not running.

this is for heartbeat 1.X, or heartbeat 2.x in the non-crm mode.
the heartbeat crm-mode is happy with this requirements, too, but does
support some other ways of doing things, too.

: Lars Ellenberg                                  Tel +43-1-8178292-0  :
: LINBIT Information Technologies GmbH            Fax +43-1-8178292-82 :
: Schoenbrunner Str. 244, A-1120 Vienna/Europe   http://www.linbit.com :
please use the "List-Reply" function of your email client.

More information about the drbd-user mailing list