DHCP Failover -- Proper method for adding pools to an existing setup.

Holger Honert holger.honert at signal-iduna.org
Fri Aug 31 09:00:59 UTC 2007


I am syncing the conf files (include file as glenn wrote) with  rsync 
and ssh to the secondary server.
After I have edited the primary file, I am restarting the primary server 
(surely after checking syntax)
and sync the file with the secondary.
Here is what is look like (/etc/rc.d/dhcpd):

#!/bin/sh

### BEGIN INIT INFO
# Provides: DHCP
# Required-Start: $network
# Required-Stop:  $network
# Default-Start:  2 3 5
# Default-Stop:   0 1 6
# Description:    Start the dhcpd
### END INIT INFO

# Source SuSE config
. /etc/rc.status

rc_reset

DHCP_BIN=/usr/sbin/dhcpd

case $1 in
        start)
                echo -n "Starting DHCPD"
                startproc $DHCP_BIN
                rc_status -v
                ;;
        stop)
                echo -n "Stopping DHCPD"
                killproc dhcpd
                rc_status -v
                ;;
        restart)
                # Checking  dhcpd-config files
                $DHCP_BIN -t -T
                if [ $? -eq 0 ]; then
                  echo -n "Restarting DHCPD"
                  # syncing conf-files with failover peer, this is one 
line !
                  rsync -auz -e "ssh -i /root/cron/rsync-key" 
/etc/dhcpd.master root at secondary-server:/etc
                  killproc dhcpd
                  startproc $DHCP_BIN
                  rc_status -v
                else
                 echo " Error in dhcpd.master file!!"
                 echo " Check config with dhcpd -t -T"
                 rc_failed 1
                fi
                rc_status -v
                ;;
        *)
                echo "Usage: $0 start|stop|restart"
                ;;
esac

My dhcpd.conf file:

log-facility local1;
failover peer "local" {
        primary;
        address pri.ad.dr.ess;
        port 847;
        peer address sec.ad.dr.ess;
        peer port 647;
        max-response-delay 60;
        max-unacked-updates 10;
        mclt 600;
        split 255;
        load balance max seconds 3;
}

include "/etc/dhcpd.master";



There's a really good "HowTo" from Troy Johnson: http://troy.jdmz.net/rsync/

HtH

Greetings

Holger



Glenn Satchell schrieb:
> All looks reasonable except for step 7, although I think you are
> over-complicating things.
>
> The way I normally do it:
>
> 1. edit dhcpd.conf
> 2. syntax check
> 3. copy to secondary (I have an include file that handles the failover peer 
> definitions).
> 4. restart dhcpd on secondary
> 5. restart dhcpd on primary
>
> regards,
> -glenn
>
>
>   
>> Date: Wed, 29 Aug 2007 12:08:28 -0500
>> From: "Cory Meyer" <cory.meyer at gmail.com>
>> To: dhcp-users at isc.org
>> Subject: DHCP Failover -- Proper method for adding pools to an existing setup.
>> X-archive-position: 4410
>> X-ecartis-version: Ecartis v1.0.0
>> X-original-sender: cory.meyer at gmail.com
>> List-software: Ecartis version 1.0.0
>> X-List-ID: <dhcp-users.isc.org>
>> X-list: dhcp-users
>>
>> Does anyone have any methods or examples of the proper way to add additional
>> pools to a currently running  failover setup?
>> In my test setup I have 2 Debian Sarge servers both running 3.0.5.
>>
>> The current method that I'm testing is:
>>
>> 1.  Update dhcp configuration with the new pool info.
>> 2.  Test ( /usr/sbin/dhcpd -t -cf /etc/dhcp/dhcpd.conf )
>>  * Continue if configuration passed.
>> 3.  Via OMAPI put the secondary dhcp server into shutdown mode
>> (local-state=10)
>> 4.  Kill dhcpd process since the shutdown mode didn't actually kill the
>> process.
>> 5.  Restart dhcpd on the primary server,   primary moves from startup to
>> partner-down
>> 6.  copy pools configuration from primary to secondary.
>> 7.  Clean out leases on secondary (cat /dev/null > /var/state/dhcpd.leases)
>>   * Above is required to remove the shutdown state.
>> 8.  Start dhcpd process on secondary.
>> 9.  Secondary moves from startup to recover.
>>
>> Thoughts/comments?
>>
>>
>>
>>     
>
>
>
>   



SIGNAL Krankenversicherung a. G.
Sitz: Dortmund, HR B 2405 AG Dortmund, Ust-IdNr. DE 124906350
IDUNA Vereinigte Lebensversicherung aG fur Handwerk, Handel und Gewerbe
Sitz: Hamburg, HR B 2740 AG Hamburg, Ust-IdNr. DE 118617622
SIGNAL Unfallversicherung a. G.
Sitz: Dortmund, HR B 2220, AG Dortmund, Ust-IdNr. DE 124906341
SIGNAL IDUNA Allgemeine Versicherung AG
Sitz: Dortmund, HR B 19108, AG Dortmund, Ust-IdNr. DE 118617622

Vorstande:
Reinhold Schulte (Vorsitzender), Dr. Karl-Josef Bierth, Michael Johnigk,
Ulrich Leitermann, Michael Petmecky, Dr. Klaus Sticker, Vorsitzender der
Aufsichtsrate: Gunter Kutz

SIGNAL IDUNA Gruppe Hauptverwaltungen, Internet: www.signal-iduna.de,
E-Mail: info at signal-iduna.de

44121 Dortmund, Hausanschrift: Joseph-Scherer-Str. 3, 44139 Dortmund,
Telefon: (02 31) 1 35-0, Telefax: (02 31) 1 35-46 38

20351 Hamburg, Hausanschrift: Neue Rabenstra?e 15-19, 20354 Hamburg,
Telefon: (0 40) 41 24-0, Telefax: (0 40) 41 24-29 58
-------------- next part --------------
A non-text attachment was scrubbed...
Name: holger.honert.vcf
Type: text/x-vcard
Size: 290 bytes
Desc: not available
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20070831/bc9e79ec/attachment.vcf>


More information about the dhcp-users mailing list