Failover strangeness

Glenn Satchell Glenn.Satchell at uniq.com.au
Fri Oct 13 14:48:45 UTC 2006


>X-Original-To: dhcp-users at webster.isc.org
>Date: Fri, 13 Oct 2006 10:01:37 -0400
>From: Greg G <ggersh at ctc.net>
>To: dhcp-users at isc.org
>Subject: Re: Failover strangeness
>X-archive-position: 1976
>X-ecartis-version: Ecartis v1.0.0
>X-original-sender: ggersh at ctc.net
>List-software: Ecartis version 1.0.0
>X-List-ID: <dhcp-users.isc.org>
>X-list: dhcp-users
>
>Glenn Satchell wrote:
>>> Date: Fri, 13 Oct 2006 08:56:04 -0400
>>> From: Greg G <ggersh at ctc.net>
>>> To: dhcp-users at isc.org
>>> Subject: Re: Failover strangeness
>>>
>>> David W. Hankins wrote:
>>>     
>>>> On Wed, Oct 11, 2006 at 12:28:30PM -0400, Greg G wrote:
>>>>   
>>>>       
>>>>>    STOS? I'm not familiar with that.  I see a reference to it in the 
>>>>>     
>>>>>         
>>>> "Start Time Of Service" - the time at which the server entered
>>>> a given state (in this case, partner-down).
>>>>
>>>>   
>>>>       
>>>   I think that might be part of the problem.  At no time is either 
>>> server going into partner-down.  They never get out of 
>>> communications-interrupted.  The man page says something about forcing a 
>>> server into partner-down, but never gives a specific enough example that 
>>> I can figure out how actually to do it via omapi.  (I still can't figure 
>>> out how to open the partner state object.)  I don't want to have to 
>>> restart the primary server to do it, as I'm somewhat allergic to editing 
>>> the lease file.
>>>     
>>
>> If the two servers never get out of communications-interrupted, then
>> there is some sort of networking or configuration problem. If the two
>> servers can communicate then they should move to normal pretty
>> quickly.
>>
>>   
>    I'm not sure what you're trying to say here.
>
>   The secondary dhcp server is down, but the running server is still 
>showing as being in communications-interrupted.  It never gets to 
>partner-down.

Ahh, didn't realise the second server was down. partner-down mode must
be set manually. There is one method described in the dhcpd.conf man
page, by editting the leases file.

It can also be done using omshell. This is from a posting to the list
in June this year.

Here's the interactive version.

Note that we set the local state to indicate the partner is down. This
means that our local server now thinks it's partner (the other box) is
down. If you run this on a system where both servers are up, it will
cycle through partner-down and back to normal pretty quickly (30
seconds or so) so you can test it.

omshell
> server <hostname>   
> port 7911
> key <keyname> <secret> 
> connect
obj: <null>
> new failover-state
obj: failover-state
> set name = "<failovername>"   - the quotes are required here!
obj: failover-state
name = "foo"
> open
...
partner-state = 00:00:00:02
local-state = 00:00:00:02
...
> set local-state = 00:00:00:01
...
partner-state = 00:00:00:02
local-state = 00:00:00:01
...
> update
...
partner-state = 00:00:00:02
local-state = 00:00:00:01
...

It's easy enough to put this in a shell script:

omshell <<END
server <hostname>   
port 7911
key <keyname> <secret> 
connect
new failover-state
set name = "<failovername>"
open
set local-state = 00:00:00:01
update
END

The failover states are defined in includes/failover.h, 2 = normal.

/* A failover peer. */
enum failover_state {
        unknown_state,
        partner_down,
        normal,
        communications_interrupted,
        resolution_interrupted,
        potential_conflict,
        recover,
        recover_done,
        shut_down,
        paused,
        startup,
        recover_wait
};


You also need to enable omapi in dhcpd.conf. See dhcpd.conf man page
for details on creating secrets.

# OMAPI
omapi-port 7911;
key <keyname> {
  algorithm hmac-md5;
  secret <secret>
}
omapi-key <keyname>;

regards,
-glenn
--
Glenn Satchell     mailto:glenn.satchell at uniq.com.au | Some days we are
Uniq Advances Pty Ltd         http://www.uniq.com.au | the flies;  some
PO Box 70 Paddington NSW Australia 2021              | days we  are the
tel:0409-458-580  tel:02-9380-6360  fax:02-9380-6416 | windscreens...


More information about the dhcp-users mailing list