TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How do I failover the load balancer

5 点作者 huntern将近 14 年前
I'm trying to make sure the servers for my product are available as much as possible, one of the problems I couldn't figure out how to solve was how to fail-over the load balancer. How do you do it?

3 条评论

RyanGWU82将近 14 年前
Are you using software like Nginx or haproxy, or a hardware load balancer? If you're using software, then I recommend using something like Heartbeat to share an IP address between the two. It basically does the same thing that mahadri suggested, but it's automatic. Here's how it works.<p>Let's say you have two servers, primary and secondary -- primary is the one that's currently acting as your load balancer. When both servers are running Heartbeat, they exchange UDP pings every second. If the primary server stops responding, then the Heartbeat process on the backup server will automatically take over the shared IP. When the primary box returns, it won't cause any problems or steal back the IP address, until you explicitly instruct it to do so. (If you really wanted it to steal back the IP automatically, I'm sure you could configure it that way.) You can also initiate a failover with a single command, which is useful when you need to do maintenance on the primary box. Running "/usr/share/heartbeat/hb_takeover all" is a lot simpler than having to manually reassign the IP address.<p>My company's infrastructure is very dependent on heartbeat -- we use it to support our load balancers and all our back-end services. You need to be careful or it will do "surprising" things when you're rebooting or changing the network config, but on the whole it makes it cheaper and easier to provide highly-available services.<p>Of course, if you're using a hardware load balancer, it should have a similar failover protocol built-in. I'd recommend just using its built-in features, that's what you're paying the big bucks for.
mahadri将近 14 年前
Does this (<a href="http://www.howtoforge.com/high-availability-load-balancer-haproxy-heartbeat-debian-etch" rel="nofollow">http://www.howtoforge.com/high-availability-load-balancer-ha...</a>) guide answer your question? Failover of the load balancer is described in sections 1 and 5 (on page 2).<p>The load balancers share one public IP address. Only one server at a time is assigned that address. To failover: 1. Physically isolate the failed load balancer by removing power and/or disabling its Ethernet port on the switch. 2. Assign the shared public IP address to the new active load balancer. 3. Broadcast an unsolicited ARP reply from the new active load balancer.
评论 #2880887 未加载
0bit将近 14 年前
have you seen Eddie:<p><a href="http://eddie.sourceforge.net/what.html" rel="nofollow">http://eddie.sourceforge.net/what.html</a>