Active-passive load balancing #14763
-
|
Hi folks, we have a situation where we would need to route traffic to a higher availability static page, whenever our primary on-prem server is down due to power outage or any physical hardware hiccups. AFAIK, Kong's load balancing leans more on the active-active load balancing, where each target on an upstream can be set to some arbitrary weight. Surfing around the internet, especially in the topic discussed here https://discuss.konghq.com/t/failover-api-handling/1341/19, it seems to suggest that a way to achieve this is to basically hack the weight to a very minimum weight but with the drawback that even if the active pool is up, some traffic might be routed to the passive pool. Another solution that I can think of is again hacking our way through "blue-green deployment" https://developer.konghq.com/gateway/traffic-control/blue-green-deployments, but this would involve a manual switch from blue to green, vice-versa. My question is:
We have implemented this in the edge LB in CloudFlare (https://developers.cloudflare.com/load-balancing/load-balancers/common-configurations/#active---passive-failover), but there are some cases where Kong is up but its upstream is not. Thanks 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Eventually we made use of the Post-Plugin Function plugin, and add something like this to be triggered during Header Filter phase: if kong.response.get_status() > 500 then
kong.response.set_headers({
["Location"] = "<insert-link>"
})
return kong.response.exit(302, "<insert-message>")
end |
Beta Was this translation helpful? Give feedback.
Eventually we made use of the Post-Plugin Function plugin, and add something like this to be triggered during Header Filter phase: