yyyar / gobetween

:cloud: Modern & minimalistic load balancer for the Сloud era
http://gobetween.io
Other
1.94k stars 210 forks source link

Backup routing #62

Open nickdoikov opened 7 years ago

nickdoikov commented 7 years ago

Need to implement backup server functionality. When all backends for server failed - use separate single host for backup connections. This will dramatically increase redundancy in big geo distributed infrastructures.

yyyar commented 7 years ago

http://blog.haproxy.com/2013/12/23/failover-and-worst-case-management-with-haproxy/

nickdoikov commented 7 years ago

backup is not a backend but more is a routing on disaster logic. we need use multiple backup hosts in list sequentially, not in parallel. because list of backup servers in most cases will be point to server frontend of different gobetween in nearest geo location , second backup farest away from first and so on.

illarion commented 7 years ago

Proposed config and simple rules:

[servers.sample]
...
[servers.sample.backup]
healthcheck_min_backends = 2
servers_list = [
     "foo.bar:8000",
     "foo.bar.cn:8000"
]
nickdoikov commented 7 years ago

Only one backup server will be used -- first that have passed healthcheck mechanism should not be dependable to health checks possible race conditions.

i think we should made a check optional for backup servers and not dependable to server checks (separate on/of for the backup sedvers)

[servers.sample]
...
[servers.sample.backup]
healthcheck_min_backends = 2
healthcheck_enable=true|false
servers_list = [
     "foo.bar:8000",
     "foo.bar.cn:8000"
]
illarion commented 7 years ago

What will happen if there's more than one backup server with heatlhchecks turned off, and first of them fails? How should gobetween decide to route traffic to the second one?

nickdoikov commented 7 years ago

need to take first one. rest other will be ignored .

illarion commented 7 years ago
[servers.sample]
...
[servers.sample.backup]
servers_list = [
    "foo.bar:8000",
    "foo.bar.cn:8000"
]

[servers.sample.backup.healthcheck]
enabled=true|false
min_backends = 2
#other options similar to usual backend healthcheck
praveenkumar2608 commented 4 years ago

This feature would be very helpful if it gets implemented.

illarion commented 4 years ago

I am planning to implement this using weight + priority and some additional configuration