How to achieve 3 nodes active/backup with failover?


I know failover already supported from 2.7 and I have read the doc about it. But I don't know how to config 3 nodes active/backup with failover as below:

  • 3 backends service A, B and C with health check
  • A is the default active backend. All traffic go through A when it is ok
  • Both B and C are the backup backends
  • When A failed, B can take all traffic
  • When both A and B failed, C can take all traffic
  • When A restored, A will take all traffic again

Can anyone help me a example configuration file?

Maybe this works, haven’t tested it:

## Dynamic configuration
        service: main
        fallback: backup
        service: backup1
        fallback: backup2

IMHO your "backup" is not very efficient, as every target node has to be large enough to handle all traffic. We use 3 backend nodes, they run in parallel. They are sized for 2 to handle all the traffic, one can fail, they would be only "half the size" of your nodes. Of course this depends on your desired availability and budget.

If for session reasons your clients need to connect to the same backend again, you can use sticky sessions.

It works, thank you!

The reason of such usage is, we have a 3 nodes cluster system. Every application is running on each node. However, one of them must running in active/backup mode...