mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-20 21:31:28 +02:00
[MINOR] checks: add the ability to disable a server in the config
Adding the "disabled" keyword on a server line disables it. It can then be enabled again on the unix socket.
This commit is contained in:
parent
42d2c6c1be
commit
9683909dce
@ -5392,6 +5392,15 @@ cookie <value>
|
|||||||
|
|
||||||
Supported in default-server: No
|
Supported in default-server: No
|
||||||
|
|
||||||
|
disabled
|
||||||
|
The "disabled" keyword starts the server in the "disabled" state. That means
|
||||||
|
that it is marked down in maintenance mode, and no connection other than the
|
||||||
|
ones allowed by persist mode will reach it. It is very well suited to setup
|
||||||
|
new servers, because normal traffic will never reach them, while it is still
|
||||||
|
possible to test the service by making use of the force-persist mechanism.
|
||||||
|
|
||||||
|
Supported in default-server: No
|
||||||
|
|
||||||
error-limit <count>
|
error-limit <count>
|
||||||
If health observing is enabled, the "error-limit" parameter specifies the
|
If health observing is enabled, the "error-limit" parameter specifies the
|
||||||
number of consecutive errors that triggers event selected by the "on-error"
|
number of consecutive errors that triggers event selected by the "on-error"
|
||||||
|
@ -3181,7 +3181,8 @@ stats_error_parsing:
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
newsrv->health = newsrv->rise;
|
if (newsrv->health)
|
||||||
|
newsrv->health = newsrv->rise;
|
||||||
cur_arg += 2;
|
cur_arg += 2;
|
||||||
}
|
}
|
||||||
else if (!strcmp(args[cur_arg], "fall")) {
|
else if (!strcmp(args[cur_arg], "fall")) {
|
||||||
@ -3332,6 +3333,12 @@ stats_error_parsing:
|
|||||||
do_check = 1;
|
do_check = 1;
|
||||||
cur_arg += 1;
|
cur_arg += 1;
|
||||||
}
|
}
|
||||||
|
else if (!defsrv && !strcmp(args[cur_arg], "disabled")) {
|
||||||
|
newsrv->state |= SRV_MAINTAIN;
|
||||||
|
newsrv->state &= ~SRV_RUNNING;
|
||||||
|
newsrv->health = 0;
|
||||||
|
cur_arg += 1;
|
||||||
|
}
|
||||||
else if (!defsrv && !strcmp(args[cur_arg], "observe")) {
|
else if (!defsrv && !strcmp(args[cur_arg], "observe")) {
|
||||||
if (!strcmp(args[cur_arg + 1], "none"))
|
if (!strcmp(args[cur_arg + 1], "none"))
|
||||||
newsrv->observe = HANA_OBS_NONE;
|
newsrv->observe = HANA_OBS_NONE;
|
||||||
@ -3512,7 +3519,7 @@ stats_error_parsing:
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!defsrv)
|
if (!defsrv)
|
||||||
Alert("parsing [%s:%d] : server %s only supports options 'backup', 'cookie', 'redir', 'observer', 'on-error', 'error-limit', 'check', 'track', 'id', 'inter', 'fastinter', 'downinter', 'rise', 'fall', 'addr', 'port', 'source', 'minconn', 'maxconn', 'maxqueue', 'slowstart' and 'weight'.\n",
|
Alert("parsing [%s:%d] : server %s only supports options 'backup', 'cookie', 'redir', 'observer', 'on-error', 'error-limit', 'check', 'disabled', 'track', 'id', 'inter', 'fastinter', 'downinter', 'rise', 'fall', 'addr', 'port', 'source', 'minconn', 'maxconn', 'maxqueue', 'slowstart' and 'weight'.\n",
|
||||||
file, linenum, newsrv->id);
|
file, linenum, newsrv->id);
|
||||||
else
|
else
|
||||||
Alert("parsing [%s:%d]: default-server only supports options 'on-error', 'error-limit', 'inter', 'fastinter', 'downinter', 'rise', 'fall', 'port', 'minconn', 'maxconn', 'maxqueue', 'slowstart' and 'weight'.\n",
|
Alert("parsing [%s:%d]: default-server only supports options 'on-error', 'error-limit', 'inter', 'fastinter', 'downinter', 'rise', 'fall', 'port', 'minconn', 'maxconn', 'maxqueue', 'slowstart' and 'weight'.\n",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user