Am 24.01.2016 17:58 schrieb Jeff Buchbinder:
The way we've done it has been to add a maintenance server to all of
our backends, then use the admin socket to iteratively disable all
"real" servers for our backends. The maintenance server points all
requests to your temporary page.
Something like:
server maintenance 10.0.5.10:80 backup check inter 15000 rise 2 fall
5
We're doing yet another approach, which is easier to "steer".
Watch closely about the logic ..
frontend whatever
acl usrnb nbsrv(usr) gt 0
acl usr_h_nb nbsrv(usr_h) eq 0
use_backend usr if usrnb usr_h_nb
use_backend usr_h
backend usr
server usr usr021:8080 check downinter 30000 fastinter 3000 fall 2
backend usr_h
server helper localhost:8000 check downinter 30000 fastinter 3000 fall
2
option httpchk GET /maint.txt HTTP/1.1\r\nHost:\ hidden
- NO need to fiddle with haproxy.conf and/or restarts of haproxy itself
- regular ops: usrnb is true, usr_h_nb is false (no maint.txt/nginx)
- irr ops: usrnb is false -> use usr_h (which has its own logic for
serving sorry pages)
- maint: "touch maint.txt" -> usr_h_nb is false -> use usr_h (value of
usrnb irrelevant)
FTR; nginx.conf snippet:
server {
listen 8000;
server_name hidden;
access_log /var/log/nginx/maint.log main;
location /maint.txt { access_log off; }
location / {
sorry-pages-things;
}
}
HTH,
--
pb