openresty / lua-resty-balancer

A generic consistent hash implementation for OpenResty/Lua
322 stars 77 forks source link

Question: How to configure backup node #6

Open rohitjoshi opened 8 years ago

rohitjoshi commented 8 years ago

Hello, nginx has support for configuring upstream as backup which allows to fail over. How can I achieve similar results with resty balancer? Either using weight (1-0) or other flag?

Can I configure weight 1 and 0 where upstream with weight 0 will be only used if upstream with 1 fails?

doujiang24 commented 8 years ago

@rohitjoshi Not yet. You need to write your own Lua code to implement it for now:) Maybe the resty.balancer can implement it in the future, it's a todo.

shenshouer commented 5 years ago

any update for backup?

doujiang24 commented 5 years ago

@shenshouer not yet, it's recommended to use implement the backup thing in another upper level.

praddy26 commented 4 years ago

Any update on the same? or if anyone has implemented backup, please give some pointers.