-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added host failover #81
Conversation
I think this is not worth the complexity in HappyBase, since it's a complex problem that isn't solved properly using a simple (Furthermore, your code has typos in variable names so I doubt it's actually tested...) |
I do not see what you mean by complexity. This is a very simple solution to the problem. Not the best one, but it works, which is a nicer alternative to having your job just fail if the Thriftserver is dead. Also I do not know what typos you are referring to. The first commit was done from a wrong dir. This code is currently running in multiple jobs. Just thought it was worth proposing.I am not sold on using a load balancer for simple host rotation, which is the problem I was trying to solve here.I might be wrong though. Anyhow thanks for the consideration I am closing this and will try using HaProxy or Nginx for this. |
There's a few things to note here:
Re. the typos: |
Also, the functionality as proposed in this PR can also be implemented outside of Happybase by simply creating a function that wraps |
Yes I understand now, there was not a lot of information on these topics. I looked into HAProxy and I am probably migrating our solution to that now. Thanks for the clarification. Also any thoughts or experiences on using Zookeeper for this? |
Sorry @Arttii can't help you; no experience. But perhaps @chase-seibert can join the discussion? |
I would just echo again that an external load balancer is a more complete solution to the same problem. Not only do you get fail-over, but you can also distribute load evenly between two hot hosts, versus having one hot and one passive. Even if you tried to do that in code, you would run into the problem of some hosts maintaining long-lived connections to a particular server. Other hosts would not be able to take that information into account to implement a truly least-connection load balancing scheme. |
Yes thank you, I realize now I was kinda missing the point with my solution. I implemented the failover with HAProxy now. Works quite well, thanks for the insight. From: Chase Seibertmailto:notifications@github.com I would just echo again that an external load balancer is a more complete solution to the same problem. Not only do you get fail-over, but you can also distribute load evenly between two hot hosts, versus having one hot and one passive. Even if you tried to do that in code, you would run into the problem of some hosts maintaining long-lived connections to a particular server. Other hosts would not be able to take that information into account to implement a truly least-connection load balancing scheme. Reply to this email directly or view it on GitHub: |
Added a basic mechanism for host failover. You just need to supply a list of other hosts to try. Its a simple solution, but seems to work ok.