Permalink
Browse files

keepalived-1.1.13

* 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...
1 parent fd91a82 commit 835e57d94db506071d2203a20b7c006a5c4a1b26 Alexandre Cassen committed Oct 11, 2006
Showing with 1,016 additions and 145 deletions.
  1. +7 −0 CONTRIBUTORS
  2. +78 −0 ChangeLog
  3. +1 −1 VERSION
  4. +3 −0 configure
  5. +3 −0 configure.in
  6. +57 −3 doc/keepalived.conf.SYNOPSIS
  7. +142 −0 doc/samples/keepalived.conf.vrrp.localcheck
  8. +1 −1 genhash/Makefile.in
  9. +1 −1 keepalived/Makefile.in
  10. +1 −1 keepalived/check/check_api.c
  11. +1 −1 keepalived/check/check_daemon.c
  12. +1 −1 keepalived/check/check_data.c
  13. +1 −1 keepalived/check/check_http.c
  14. +1 −1 keepalived/check/check_misc.c
  15. +21 −1 keepalived/check/check_parser.c
  16. +1 −1 keepalived/check/check_smtp.c
  17. +1 −1 keepalived/check/check_ssl.c
  18. +1 −1 keepalived/check/check_tcp.c
  19. +1 −1 keepalived/check/ipfwwrapper.c
  20. +10 −2 keepalived/check/ipvswrapper.c
  21. +1 −1 keepalived/check/ipwrapper.c
  22. +1 −1 keepalived/core/daemon.c
  23. +1 −1 keepalived/core/global_data.c
  24. +1 −1 keepalived/core/global_parser.c
  25. +1 −1 keepalived/core/layer4.c
  26. +1 −1 keepalived/core/main.c
  27. +1 −1 keepalived/core/pidfile.c
  28. +1 −1 keepalived/core/smtp.c
  29. +1 −1 keepalived/include/check_api.h
  30. +1 −1 keepalived/include/check_daemon.h
  31. +5 −1 keepalived/include/check_data.h
  32. +1 −1 keepalived/include/check_http.h
  33. +1 −1 keepalived/include/check_misc.h
  34. +1 −1 keepalived/include/check_parser.h
  35. +1 −1 keepalived/include/check_smtp.h
  36. +1 −1 keepalived/include/check_ssl.h
  37. +1 −1 keepalived/include/check_tcp.h
  38. +1 −1 keepalived/include/config.h.in
  39. +1 −1 keepalived/include/daemon.h
  40. +1 −1 keepalived/include/global_data.h
  41. +1 −1 keepalived/include/global_parser.h
  42. +1 −1 keepalived/include/ipfwwrapper.h
  43. +1 −1 keepalived/include/ipvswrapper.h
  44. +1 −1 keepalived/include/ipwrapper.h
  45. +1 −1 keepalived/include/layer4.h
  46. +1 −1 keepalived/include/main.h
  47. +1 −1 keepalived/include/pidfile.h
  48. +1 −1 keepalived/include/smtp.h
  49. +6 −3 keepalived/include/vrrp.h
  50. +1 −1 keepalived/include/vrrp_arp.h
  51. +1 −1 keepalived/include/vrrp_daemon.h
  52. +4 −1 keepalived/include/vrrp_data.h
  53. +7 −1 keepalived/include/vrrp_if.h
  54. +1 −1 keepalived/include/vrrp_index.h
  55. +1 −1 keepalived/include/vrrp_ipaddress.h
  56. +1 −1 keepalived/include/vrrp_iproute.h
  57. +1 −1 keepalived/include/vrrp_ipsecah.h
  58. +1 −1 keepalived/include/vrrp_netlink.h
  59. +1 −1 keepalived/include/vrrp_notify.h
  60. +1 −1 keepalived/include/vrrp_parser.h
  61. +1 −1 keepalived/include/vrrp_scheduler.h
  62. +1 −1 keepalived/include/vrrp_sync.h
  63. +31 −1 keepalived/include/vrrp_track.h
  64. +3 −3 keepalived/vrrp/Makefile.in
  65. +20 −15 keepalived/vrrp/vrrp.c
  66. +1 −1 keepalived/vrrp/vrrp_arp.c
  67. +1 −1 keepalived/vrrp/vrrp_daemon.c
  68. +90 −2 keepalived/vrrp/vrrp_data.c
  69. +1 −1 keepalived/vrrp/vrrp_if.c
  70. +1 −1 keepalived/vrrp/vrrp_index.c
  71. +1 −1 keepalived/vrrp/vrrp_ipaddress.c
  72. +1 −1 keepalived/vrrp/vrrp_iproute.c
  73. +1 −1 keepalived/vrrp/vrrp_ipsecah.c
  74. +1 −1 keepalived/vrrp/vrrp_netlink.c
  75. +17 −10 keepalived/vrrp/vrrp_notify.c
  76. +45 −4 keepalived/vrrp/vrrp_parser.c
  77. +229 −2 keepalived/vrrp/vrrp_scheduler.c
  78. +4 −3 keepalived/vrrp/vrrp_sync.c
  79. +144 −12 keepalived/vrrp/vrrp_track.c
  80. +1 −1 lib/html.c
  81. +1 −1 lib/html.h
  82. +1 −1 lib/list.c
  83. +1 −1 lib/list.h
  84. +1 −1 lib/memory.c
  85. +1 −1 lib/memory.h
  86. +1 −1 lib/notify.c
  87. +1 −1 lib/notify.h
  88. +1 −1 lib/parser.c
  89. +1 −1 lib/parser.h
  90. +7 −4 lib/scheduler.c
  91. +1 −1 lib/scheduler.h
  92. +1 −1 lib/signals.c
  93. +1 −1 lib/signals.h
  94. +7 −1 lib/timer.c
  95. +1 −1 lib/timer.h
  96. +1 −1 lib/utils.c
  97. +1 −1 lib/utils.h
  98. +1 −1 lib/vector.c
  99. +1 −1 lib/vector.h
View
@@ -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.
View
@@ -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
View
@@ -1 +1 @@
-1.1.12
+1.1.13
View
@@ -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;
View
@@ -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;
@@ -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 :
@@ -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 :
@@ -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.
@@ -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
}
@@ -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 :
@@ -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
+ }
+}
View
@@ -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
@@ -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
@@ -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>
*
@@ -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>
*
Oops, something went wrong.

0 comments on commit 835e57d

Please sign in to comment.