0

I have 2 web servers: A and B with haproxy before them. I'd like to use A as a master and B as a backup/failover server.

I'd like to know whether it is possible to have:

  • no automatic switch to B in case A is down during office hours
  • automatic switch to B in case A is down during non office hours

Is that possible?

1 Answer 1

1

You can switch configs on schedule. Make two haproxy configs, one for office hours - without failover, another for failover, and switch them with cron.

2
  • When I switch files I'll need to restart haproxy, is that right? So I may be losing a couple of requests twice per day.
    – cherouvim
    Feb 19, 2016 at 20:28
  • 1
    AFAIK haproxy supports reload. So it finishes current requests, then processes new requests with new configuration.
    – anx
    Feb 20, 2016 at 11:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .