Skip to content

Commit

Permalink
keepalived-1.1.13
Browse files Browse the repository at this point in the history
* keepalived-1.1.13 released.
* VRRP : Added a new notify script to be launch during vrrp
  instances shutdown. This new notify hook is configured
  using notify_stop keyword inside vrrp_instance block.
* VRRP : Willy Tarreau <w at 1wt.eu> fixed an errno issue in
  thread_fetch(), errno is lost during set_time_now(). This
  patch saves it across the call to set_time_now() in order
  to get the valid error.
* VRRP : Willy Tarreau <w at 1wt.eu> extended timer framework
  to save errno in timer_now() and set_time_now() just in
  case other functions do not expect these functions to modify
  it. This is a safer approach than the initial patch to
  thread_fetch(), while still compatible.
* VRRP : Willy Tarreau <w at 1wt.eu> fixed an FSM silent issue.
  By default, the VRRP daemon stops sending during new MASTER
  elections. This causes 3 to 4 seconds of silence depending on
  the local priority, and sometimes causes flapping when the
  differences in priorities are very low, due to the kernel timer's
  resolution : sometimes, the old master receives a first
  advertisement, enters backup, waits 3 seconds, sees nothing and
  finally becomes master again, which forces a new reelection on
  the other one.
* VRRP : Willy Tarreau <w at 1wt.eu> extended VRRP framework to
  support floating priority. Replace the priority in each
  vrrp_instance with a base priority and an effective priority,
  to prepare the support for floating priorities. The configuration
  sets the base_priority, and all comparisons use the new
  effective_priority value. This one is computed in the
  vrrp_update_priority() thread by adding an offset to base_priority,
  based on the result of various checks.
* VRRP : Willy Tarreau <w at 1wt.eu> extended notify script to add
  the priority in "$4" when calling a notify script. This is
  important in labs and datacenters when systems can display the
  priority on a front LCD, because it allows workers to carefully
  operate without causing unexpected reelections.
* VRRP : Willy Tarreau <w at 1wt.eu> extended interface tracking
  framework to let interface tracking change the priority by adding
  a "weight" parameter. If the weight is positive, it will be added
  to the priority when the interface is UP. If the weight is negative,
  it will be subtracted from the priority when the interface is down.
  If the weight is zero (default), a down interface will switch the
  instance to the FAULT state.
* VRRP : Willy Tarreau <w at 1wt.eu> added a new "vrrp_script" section
  to monitor local processes or do any type of local processing to
  decide whether the machine is in good enough health to be elected
  as master. A same script will be run once for all instances which
  monitor it. If no instance use it, it will not be run, so that it's
  safe to declare a lot of useful scripts. A weight is associated to
  the script result. If the weight is positive, it will be added to
  the priority when the result is OK (exit 0). If the weight is
  negative, it will be subtracted from the priority when the result
  is KO (exit != 0). If the weight is zero, the script will not be
  monitored. The default value is 2.
* VRRP : Willy Tarreau <w at 1wt.eu> extended vrrp scheduler so that
  when a VRRP is part of a SYNC group, it must not use floating
  priorities, otherwise this may lead to infinite re-election after
  every advertisement because some VRRPs will announce higher prios
  than the peer, while others will announce lower prios. The solution
  is to set all weights to 0 to enable standard interface tracking,
  and to disable the update prio thread if VRRP SYNC is enabled on a
  VRRP.
* VRRP : Willy Tarreau <w at 1wt.eu> added some documentation and
  examples for the brand new VRRP tracking mechanisms.
* VRRP : Ranko Zivojnovic, <ranko at spidernet.net> fixed vrrp
  scheduler to execute notify* scripts in transition from the
  failed state to the backup state.
* Nick Couchman, <nick.couchman at seakr.com>, added support for
  real server upper and lower thresholds.  This allows you to set
  a minimum and maximum number of connections to each real server
  using the "uthreshold" (maximum) and "lthreshold" (minimum)
  options in the real_server section of the configuration file.
* Chris Caputo, <ccaputo at alt.net> extended autoconf script
  to support recent move of UTS_RELEASE from linux/version.h to
  linux/utsrelease.h.
* Chris Caputo, <ccaputo at alt.net> extended ipvswrapper 2.4
  code to support misc_dynamic weight.
  • Loading branch information
Alexandre Cassen committed Sep 28, 2009
1 parent fd91a82 commit 835e57d
Show file tree
Hide file tree
Showing 99 changed files with 1,016 additions and 145 deletions.
7 changes: 7 additions & 0 deletions CONTRIBUTORS
Expand Up @@ -20,3 +20,10 @@ Chris Caputo, <ccaputo@alt.net> :
Kevin Lindsay, <kevinl@netnation.com> :
o Fixed shadowed declaration reported by -Wshadow.
o Redesigned signal handling.

Nick Couchman, <nick.couchman at seakr.com> :
o Patch for u_threshold and l_threshold support.

Willy Tarreau, <w at 1wt.eu> :
o Extended VRRP framework to support floating
priority.
78 changes: 78 additions & 0 deletions ChangeLog
@@ -1,3 +1,81 @@
2006-10-11 Alexandre Cassen <acassen@linux-vs.org>
* keepalived-1.1.13 released.
* VRRP : Added a new notify script to be launch during vrrp
instances shutdown. This new notify hook is configured
using notify_stop keyword inside vrrp_instance block.
* VRRP : Willy Tarreau <w at 1wt.eu> fixed an errno issue in
thread_fetch(), errno is lost during set_time_now(). This
patch saves it across the call to set_time_now() in order
to get the valid error.
* VRRP : Willy Tarreau <w at 1wt.eu> extended timer framework
to save errno in timer_now() and set_time_now() just in
case other functions do not expect these functions to modify
it. This is a safer approach than the initial patch to
thread_fetch(), while still compatible.
* VRRP : Willy Tarreau <w at 1wt.eu> fixed an FSM silent issue.
By default, the VRRP daemon stops sending during new MASTER
elections. This causes 3 to 4 seconds of silence depending on
the local priority, and sometimes causes flapping when the
differences in priorities are very low, due to the kernel timer's
resolution : sometimes, the old master receives a first
advertisement, enters backup, waits 3 seconds, sees nothing and
finally becomes master again, which forces a new reelection on
the other one.
* VRRP : Willy Tarreau <w at 1wt.eu> extended VRRP framework to
support floating priority. Replace the priority in each
vrrp_instance with a base priority and an effective priority,
to prepare the support for floating priorities. The configuration
sets the base_priority, and all comparisons use the new
effective_priority value. This one is computed in the
vrrp_update_priority() thread by adding an offset to base_priority,
based on the result of various checks.
* VRRP : Willy Tarreau <w at 1wt.eu> extended notify script to add
the priority in "$4" when calling a notify script. This is
important in labs and datacenters when systems can display the
priority on a front LCD, because it allows workers to carefully
operate without causing unexpected reelections.
* VRRP : Willy Tarreau <w at 1wt.eu> extended interface tracking
framework to let interface tracking change the priority by adding
a "weight" parameter. If the weight is positive, it will be added
to the priority when the interface is UP. If the weight is negative,
it will be subtracted from the priority when the interface is down.
If the weight is zero (default), a down interface will switch the
instance to the FAULT state.
* VRRP : Willy Tarreau <w at 1wt.eu> added a new "vrrp_script" section
to monitor local processes or do any type of local processing to
decide whether the machine is in good enough health to be elected
as master. A same script will be run once for all instances which
monitor it. If no instance use it, it will not be run, so that it's
safe to declare a lot of useful scripts. A weight is associated to
the script result. If the weight is positive, it will be added to
the priority when the result is OK (exit 0). If the weight is
negative, it will be subtracted from the priority when the result
is KO (exit != 0). If the weight is zero, the script will not be
monitored. The default value is 2.
* VRRP : Willy Tarreau <w at 1wt.eu> extended vrrp scheduler so that
when a VRRP is part of a SYNC group, it must not use floating
priorities, otherwise this may lead to infinite re-election after
every advertisement because some VRRPs will announce higher prios
than the peer, while others will announce lower prios. The solution
is to set all weights to 0 to enable standard interface tracking,
and to disable the update prio thread if VRRP SYNC is enabled on a
VRRP.
* VRRP : Willy Tarreau <w at 1wt.eu> added some documentation and
examples for the brand new VRRP tracking mechanisms.
* VRRP : Ranko Zivojnovic, <ranko at spidernet.net> fixed vrrp
scheduler to execute notify* scripts in transition from the
failed state to the backup state.
* Nick Couchman, <nick.couchman at seakr.com>, added support for
real server upper and lower thresholds. This allows you to set
a minimum and maximum number of connections to each real server
using the "uthreshold" (maximum) and "lthreshold" (minimum)
options in the real_server section of the configuration file.
* Chris Caputo, <ccaputo at alt.net> extended autoconf script
to support recent move of UTS_RELEASE from linux/version.h to
linux/utsrelease.h.
* Chris Caputo, <ccaputo at alt.net> extended ipvswrapper 2.4
code to support misc_dynamic weight.

2006-03-09 Alexandre Cassen <acassen@linux-vs.org>
* keepalived-1.1.12 released.
* VRRP : Christophe Varoqui, <Christophe.Varoqui@free.fr> extended
Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
1.1.12
1.1.13
3 changes: 3 additions & 0 deletions configure
Expand Up @@ -3580,6 +3580,9 @@ cat >>conftest.$ac_ext <<_ACEOF
#include <stdlib.h>
#include <stdio.h>
#include <linux/version.h>
#if !defined(UTS_RELEASE)
#include <linux/utsrelease.h>
#endif
int main (void) {
FILE *fp = fopen ("linuxinfo", "w");
if (!fp) return 1;
Expand Down
3 changes: 3 additions & 0 deletions configure.in
Expand Up @@ -54,6 +54,9 @@ AC_TRY_RUN([
#include <stdlib.h>
#include <stdio.h>
#include <linux/version.h>
#if !defined(UTS_RELEASE)
#include <linux/utsrelease.h>
#endif
int main (void) {
FILE *fp = fopen ("linuxinfo", "w");
if (!fp) return 1;
Expand Down
60 changes: 57 additions & 3 deletions doc/keepalived.conf.SYNOPSIS
Expand Up @@ -70,12 +70,34 @@ SCOPE can take the following values :

2. VRRP configuration

This block is divided in 2 sub-block :
This block is divided in 3 sub-block :

* VRRP scripts
* VRRP synchronization group
* VRRP instance

2.1. VRRP synchronization group
2.1. VRRP scripts

The configuration block looks like :

vrrp_script <STRING> { # VRRP script declaration
script <QUOTED_STRING> # script to run periodically
interval <INTEGER> # run the script this every seconds
weight <INTEGER:-254..254> # adjust priority by this weight
}

The script will be executed periodically, every <interval> seconds. Its exit
code will be recorded for all VRRP instances which will want to monitor it.
Note that the script will only be executed if at least one VRRP instance
monitors it with a non-zero weight. Thus, any number of scripts may be
declared without taking the system down.

If unspecified, the weight equals 2, which means that a success will add +2
to the priority of all VRRP instances which monitor it. On the opposite, a
negative weight will be subtracted from the initial priority in case of
failure.

2.2. VRRP synchronization group

The configuration block looks like :

Expand Down Expand Up @@ -103,7 +125,15 @@ vrrp_sync_group <STRING> { # VRRP sync group declaration
$1 and $3 are ALWAYS sent in uppercase, and the possible strings sent are the
same ones listed above ("GROUP"/"INSTANCE", "MASTER"/"BACKUP"/"FAULT").

2.2. VRRP instance
Important: for a SYNC group to run reliably, it is vital that all instances in
the group are MASTER or that they are all either BACKUP or FAULT. A
situation with half instances having higher priority on machine A
half others with higher priority on machine B will lead to constant
re-elections. For this reason, when instances are grouped, their
tracking weights are automatically set to zero, in order to avoid
inconsistent priorities across instances.

2.3. VRRP instance

The configuration block looks like :

Expand All @@ -113,6 +143,12 @@ vrrp_instance <STRING> { # VRRP instance declaration
track_interface { # Interfaces state we monitor
<STRING>
<STRING>
<STRING> weight <INTEGER:-254..254>
...
}
track_script { # Scripts state we monitor
<STRING>
<STRING> weight <INTEGER:-254..254>
...
}
dont_track_primary # (default unset) ignore VRRP interface faults.
Expand Down Expand Up @@ -150,6 +186,7 @@ vrrp_instance <STRING> { # VRRP instance declaration
notify_master <STRING>|<QUOTED-STRING> # Same as vrrp_sync_group
notify_backup <STRING>|<QUOTED-STRING> # Same as vrrp_sync_group
notify_fault <STRING>|<QUOTED-STRING> # Same as vrrp_sync_group
notify_stop <STRING>|<QUOTED-STRING> # Script to launch when stopping vrrp
notify <STRING>|<QUOTED-STRING> # Same as vrrp_sync_group
smtp_alert # Same as vrrp_sync_group
}
Expand All @@ -161,6 +198,23 @@ SCOPE can take the following values :
* nowhere
* global

When a weight is specified in track_interface, instead of setting the vrrp
instance to the FAULT state in case of failure, its priority will be
increased by the weight when the interface is up (for positive weights),
or decreased by the weight's absolute value when the interface is down
(for negative weights). The weight must be comprised between -254 and +254
inclusive. 0 is the default behaviour which means that a failure implies a
FAULT state. The common practise is to use positive weights to count a
limited number of good services so that the server with the highest count
becomes master. Negative weights are better to count unexpected failures
among a high number of interfaces, as it will not saturate even with high
number of interfaces.

The same principle can be applied to track_script entries, except that an
unspecified weight means that the default weight declared in the script
will be used.


3. LVS configuration

This block is divided in 2 sub-block :
Expand Down
142 changes: 142 additions & 0 deletions doc/samples/keepalived.conf.vrrp.localcheck
@@ -0,0 +1,142 @@
! Configuration File for keepalived

vrrp_script chk_sshd {
script "killall -0 sshd" # cheaper than pidof
interval 2 # check every 2 seconds
weight -4 # default prio: -4 if KO
}

vrrp_script chk_haproxy {
script "killall -0 haproxy" # cheaper than pidof
interval 2 # check every 2 seconds
}

vrrp_script chk_http_port {
script "</dev/tcp/127.0.0.1/80" # connects and exits
interval 1 # check every second
weight -2 # default prio: -2 if connect fails
}

vrrp_script chk_https_port {
script "</dev/tcp/127.0.0.1/443"
interval 1
weight -2
}

vrrp_script chk_smtp_port {
script "</dev/tcp/127.0.0.1/25"
interval 1
weight -2
}

vrrp_instance VI_1 {
interface eth0
state MASTER
virtual_router_id 51
priority 100
virtual_ipaddress {
192.168.200.18/25
}
track_interface {
eth1 weight 2 # prio = +2 if UP
eth2 weight -2 # prio = -2 if DOWN
eth3 # no weight, fault if down
}
track_script {
chk_sshd # use default weight from the script
chk_haproxy weight 2 # +2 if process is present
chk_http_port
chk_https_port
chk_smtp_port
}
}

vrrp_instance VI_2 {
interface eth1
state MASTER
virtual_router_id 52
priority 100
virtual_ipaddress {
192.168.201.18/26
}
track_interface {
eth0 weight 2 # prio = +2 if UP
eth2 weight -2 # prio = -2 if DOWN
eth3 # no weight, fault if down
}
track_script {
chk_haproxy weight 2
chk_http_port
chk_https_port
chk_smtp_port
}
}

vrrp_instance VI_3 {
interface eth0
virtual_router_id 53
priority 100
virtual_ipaddress {
192.168.200.19/27
}
}

vrrp_instance VI_4 {
interface eth1
virtual_router_id 54
priority 100
virtual_ipaddress {
192.168.201.19/28
}
}

vrrp_instance VI_5 {
state MASTER
interface eth0
virtual_router_id 55
priority 100
virtual_ipaddress {
192.168.200.20/27
}
}


vrrp_instance VI_6 {
state MASTER
interface eth0
virtual_router_id 56
priority 100
virtual_ipaddress {
192.168.200.21/27
}
}

vrrp_instance VI_7 {
state MASTER
interface eth0
virtual_router_id 57
priority 100
virtual_ipaddress {
192.168.200.22/27
}
}

vrrp_instance VI_8 {
state MASTER
interface eth0
virtual_router_id 58
priority 100
virtual_ipaddress {
192.168.200.23/27
}
}

vrrp_instance VI_9 {
state MASTER
interface eth0
virtual_router_id 59
priority 100
virtual_ipaddress {
192.168.200.24/27
}
}
2 changes: 1 addition & 1 deletion genhash/Makefile.in
@@ -1,6 +1,6 @@
# Makefile.in
#
# Copyright (C) 2001-2005 Alexandre Cassen, <acassen@linux-vs.org>
# Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>

EXEC = genhash
BIN = ../bin
Expand Down
2 changes: 1 addition & 1 deletion keepalived/Makefile.in
Expand Up @@ -2,7 +2,7 @@
#
# Keepalived OpenSource project.
#
# Copyright (C) 2001, 2002, 2003 Alexandre Cassen, <acassen@linux-vs.org>
# Copyright (C) 2001-2006 Alexandre Cassen, <acassen@linux-vs.org>

EXEC = keepalived
BIN = ../bin
Expand Down
2 changes: 1 addition & 1 deletion keepalived/check/check_api.c
Expand Up @@ -5,7 +5,7 @@
*
* Part: Checkers registration.
*
* Version: $Id: check_api.c,v 1.1.12 2006/03/09 01:22:13 acassen Exp $
* Version: $Id: check_api.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
Expand Down
2 changes: 1 addition & 1 deletion keepalived/check/check_daemon.c
Expand Up @@ -5,7 +5,7 @@
*
* Part: Healthcheckrs child process handling.
*
* Version: $Id: check_daemon.c,v 1.1.12 2006/03/09 01:22:13 acassen Exp $
* Version: $Id: check_daemon.c,v 1.1.13 2006/10/11 05:22:13 acassen Exp $
*
* Author: Alexandre Cassen, <acassen@linux-vs.org>
*
Expand Down

0 comments on commit 835e57d

Please sign in to comment.