I'd like to define a proxy (tcp mode) that has multiple backend
servers yet only uses one at a time. In other words, traffic comes
into the frontend and is redirected to one backend server. Should that
server fail, another is chosen.

I realize this might be an odd thing to do with haproxy, and if you're
thinking that simple VIP failover (ie. keepalived) is better suited
for this, you are correct. Long story.

I've gotten fairly close to achieving this behavior by having all my
backend servers declared 'backup' and not using 'allbackups'. The only
caveat is that these "backup" servers have a preference based on the
order they are defined. Say my severs are defined in the backend like
this:

        server foo-01 ... backup
        server foo-02 ... backup
        server foo-03 ... backup

If foo-01 is up, all traffic will go to it. When foo-0t is down, all
traffic will go to foo-02. When foo-01 comes back online, traffic goes
back to foo-01. Ideally the backend servers would change only when it
failed. Beside, this solution is rather ugly.

Is there a better way?

Ryan

Reply via email to