English 中文(简体)
Webserver failover
原标题:

I will be running a dynamic web site and if the server ever is to stop responding, I d like to failover to a static website that displays a "We are down for maintenance" page. I have been reading and I found that switching the DNS dynamically may be an option, but how quick will that change take place? And will everyone see the change immediately? Are there any better ways to failover to another server?

问题回答

DNS has a TTL (time to live) and gets cached until the TTL expires. So a DNS cutover does not happen immediately. Everyone with a cached DNS lookup of your site still uses the old value. You could set an insanely short TTL but this is crappy for performance. DNS is almost certainly not the right way to accomplish what you are doing.

A load balancer can do this kind of immediate switchover. All traffic always hits the load balancer first which under normal circumstances proxies requests along to your main web server(s). In the event of web server crash, you can just have the load balancer direct all web traffic to your failover web server.

pound, perlbal or other software load-balancer could do that, I believe, yes

perhaps even Apache rewrite rules could allow this? I m not sure if there s a way to branch when the dynamic server is not available, though. Customize Apache 404 response to your liking?

first of all is important understand which kind of failure you want failover, if it s app/db error and the server remain up you can create a script that do some checks and failover your website to another temp page. (changing apache config or .htaccess) If is an hardware failover the DNS solution is ok but it s not immediate so you will lose some users traffic.

The best ideal solution is to use a proxy (like HAProxy) that forward the HTTP request to at least 2 webserver and automatically detect if one of those fail and switch over to the working one.

If you re using Amazon AWS you can use ELB - Elastic Load Balancer





相关问题
How do I build a DNS Query record in Erlang?

I am building a native Bonjour / Zeroconf library and need to build DNS query records to broadcast off to the other machines. I have tried looking thru the Erlang source code but as I am relatively ...

powerdns-on-rails ArgumentError

My Environments: CentOS 5 ruby 1.8.6 (2008-08-11 patchlevel 287) [x86_64-linux] Ruby Enterprise Edition 20090610 passneger or webrick I use this gem list. *** LOCAL GEMS *** actionmailer (2.3.2, 2....

简讯

我是否可以使用某些软件来建立简便的航天国家服务器,最好是在 Java? 所有我都希望我的航天国家服务机在任何要求中都用同样的IP地址来回答。

Domains & Foreward Slash

This is rather difficult to explain so please bear with me. We will be hosting 4 websites on our server and the plan is to have each site sit under its own domain: site-a.com site-b.com sub1.site-b....

Checking if a domain name is registered

How would I go about checking if a domain name is registered? I was thinking about checking if it has a corresponding IP but it doesn t seem to work as well as I had hoped. Is there a solution in ...

How do I setup a reverse DNS entry in Plesk 9.2.2 frontent?

I need to get a reverse DNS entry into my zones file for one of my domains hosted under Plesk 9.2.2. Does anybody have ANY idea how this done? If all else fails I will have to update the zones file ...

热门标签