Web Hosting Talk







View Full Version : Is this possible? (auto-redirect if server is down)


imago-allan
12-13-2001, 12:21 AM
Greetings!

I am thinking of this possibility:

A site domain.com is hosted in host A. Another site domain.net is hosted in host B.

Both domain.com and domain.net are registered under one registrar. The registrar offers URL forwarding feature.

Scenario:

A visitor goes to domain.com but host A which is hosting domain.com is down.

As a consequence, the visitor should be redirected to domain.net which is hosted by host B. A visitor can directly visit domain.net. But, we don't want that. We only want domain.net accessible if domain.com is down. In other words, domain.net "only exists" if domain.com "dies".

Questions:

1. Is the scenario possible?
2. How is the configuration set that instructs the server (or something) that will direct visitors to domain.net if domain.com is down?
3. How is the configuration set so that domain.net only allow access to its contents when domain.com is down?
4. What is done with the registrar's control panel?

Thanks in advance for the help.

BEGIN ADDED INFO:

For info, the registrar is Stargate. Here is their reply to a recent query:

"The only way I could see that happening is if you change your nameservers to Stargates only. Then activate URL Forwarding for domain.com to http://www.domain.net/. Once that has been activated, then make your primary and secondary nameserver YOURS, then make your 3rd and 4th nameserver OURS. This has not been done before so I can guarantee no results whatsoever."

END ADDED INFO

:)

MikeA
12-13-2001, 11:41 AM
Ok, before someone slams me, I've never done this, but have had a client who said it worked great for them.

Here is an alternative way to do what you want.

Host domain.com at two different hosts and put both DNS entries on the same domain.

SO:

testdomain.com

DNS1 -> ns.abc.com
DNS2 -> ns2.abc.com
DNS3 -> ns.123.com
DNS4 -> ns2.123.com

SO:

If the host at abc.com goes down, then the routers will automatically use 123.com instead, because they can't find abc.com nameserver.

There is a downside to this. E-mails and clients may hit both sites at the same time. He did tell me that that did happen sometimes.

I can get the guys name and number who did this if you want to talk to him. Shoot me an e-mail if so.

imago-allan
12-13-2001, 12:13 PM
Hi!

I was actually thinking of doing that but also thinking of possibility of email problem.

My analysis will be:

If the main host is down, then the second host takes over and loads the site. That second host will be authoritative for domain.com at this instance. When somebody sends mail, it will be stored in the second host's mail server.

Now, when the main host is up, the mails cannot be retrieved from the second host's mailserver (at least that is what I think would happen- please correct me if I am wrong) since the server authoritative for the domain.com is now the main host.

If this is the case, I am thinking that a third party mailserver should do the trick. However, the drawback would be worst if this third party mail server is down. No mail can get through even if the site is up! And this will be added cost.

I may not be able to talk to guy synchronously since I am at a different time zone. An email address would be fine.

Thanks.

More ideas on the first scenario I am talking about? Anyone?


:)

MikeA
12-13-2001, 01:51 PM
Originally posted by consul

Now, when the main host is up, the mails cannot be retrieved from the second host's mailserver (at least that is what I think would happen- please correct me if I am wrong) since the server authoritative for the domain.com is now the main host.


Actually you could check the e-mail using the IP address.

Example:

incoming for host a: mail.domain.com
incoming for host b: 123.123.123.123

zupanm
12-13-2001, 02:44 PM
use rsync to keep everything the same. So when the host comes back up everything will sync up fine

imago-allan
12-13-2001, 07:03 PM
MikeA, thanks for reminding me that I can check the mails through IP address. Cool.

zupanm, your solution seems more elegant. Please forgive me but, how do I use rsync? I haven't done this before. I am using Eudora as my mail client.

When everything is theoretically ok, we may do a test run on this. And once successful, we will inform our clients of this possibility of "redundant hosting" if they want such setup. We always do some research to improve the stability of our client's sites. But, we will have to start with ours.

Again, thanks. More ideas are welcome.


:)

allan
12-14-2001, 12:42 AM
Originally posted by MikeA

If the host at abc.com goes down, then the routers will automatically use 123.com instead, because they can't find abc.com nameserver.

There is a downside to this. E-mails and clients may hit both sites at the same time. He did tell me that that did happen sometimes.


There are a couple of problems with this (I've gotten into this argument before :)):

1. When a caching server pulls information about a domain name from authoritative name servers it does so in a round robin fashion. Which means that each of the authoritative name servers will be queried in turn.

2. After the initial query, the caching name servers will query the appropriate authortitative name server based on round trip time (ie which servers responds the fastest: http://www.acmebw.com/askmrdns/archive.php?category=83&question=3). So at any point you will have customers going to both web sites, and mail hitting both mail servers.

3. Once data from whichever name server is cached people using that caching name server will try to go whichever site is in the caching name server until the cache expires.

You can skirt option 3 by setting the TTL for the zone file to 1 second, but not al caching name servers will honor a 1 second TTL, and it increases the load on your authoritative name servers.

As to the mail issue, the simplest resolution is to set weighted mail records in both zone files. Make your primary host have the lower weight, and the secondary host have the higher weight. If your primary host goes down, the secondary host will queue the mail and try to deliver it to your primary host for up to 5 days (If your host is down longer than 5 days you have much more serious problems :)). This will always keep mail directed to your primary server, and you shouldn't lose any mail during an outage. You won't be able to check it, but you won't lose it.

bitserve
12-14-2001, 03:20 PM
Originally posted by uuallan
1. When a caching server pulls information about a domain name from authoritative name servers it does so in a round robin fashion. Which means that each of the authoritative name servers will be queried in turn.


Doesn't the RFC state that you should query both servers in parallel, to guarantee the best chance for a reply?

Not that all resolvers are RFC compliant, which certainly helps in this hacked attempt at providing redundancy through DNS.

How most resolvers work though, is that they only send parallel requests to the first two name servers. Only if those requests fail to get a response, is a request sent to any addtional nameservers. Therefore, having two sets of two name servers (primary, secondary, and two additional) might work for a lot of cases.

This is of course the only problem that I saw in what Stargate suggested, which uuallan noticed and was nice enough to point out, even though we both have different beliefs in the way that it's supposed to work.

DNS is good for load balancing, using round robin, but not for redundancy, IMHO.

allan
12-14-2001, 03:35 PM
Originally posted by bitserve

Doesn't the RFC state that you should query both servers in parallel, to guarantee the best chance for a reply?

Not that all resolvers are RFC compliant, which certainly helps in this hacked attempt at providing redundancy through DNS.


Technically speaking you are correct, that is the way they are supposed to work. I have found a number of resolvers do not seem to do that though, but if a resolver is RFC compliant, it should work in that manner.


DNS is good for load balancing, using round robin, but not for redundancy, IMHO.

I think DNS is very good for redundancy, just not in the manner which was laid out above :).

imago-allan
12-16-2001, 02:22 PM
Hello again!

What then is your proposed suggestion to achieve redundancy?
I am open.

uulan partially said:

"I think DNS is very good for redundancy, just not in the manner which was laid out above ."

:)

allan
12-16-2001, 02:26 PM
Originally posted by consul

What then is your proposed suggestion to achieve redundancy?
I am open.


How much money do you have to spend?

imago-allan
12-16-2001, 02:37 PM
Not much I think. Say $100-200 per year.

If that will not be possible, we are open to some innovative approach...

:)

allan
12-16-2001, 02:46 PM
Originally posted by consul
Not much I think. Say $100-200 per year.


Not likely, unless you plan on amortizing a solution over 10 years :).

Redundancy always costs money. You really don't have an inexpesive option to provide intra-data center redundancy. Your DNS solution is going to give you the best redundandancy given your budget, just keep in mind both sites will have to be kept current with content etc, and if you have a database driven site you will need to figure out a way to keep the data syncronized across the WAN.

imago-allan
12-16-2001, 10:27 PM
Hello!

I am more inclined to going to the suggestion of MikeA, that is having the domain hosted by two hosting companies at the same time and put the DNS entries on the control panel as DNS1 and DNS2 for the first (priority host) and DNS3 and DNS4 for the second (backup host).

Regarding mail issue. I am thinking that the solution proposed by MikeA , that is, to check the other one via IP address is quite reasonable.

Furthermore, I am in no technical expertise to do the following as suggested by uuAllan:

As to the mail issue, the simplest resolution is to set weighted mail records in both zone files. Make your primary host have the lower weight, and the secondary host have the higher weight. If your primary host goes down, the secondary host will queue the mail and try to deliver it to your primary host for up to 5 days (If your host is down longer than 5 days you have much more serious problems ). This will always keep mail directed to your primary server, and you shouldn't lose any mail during an outage. You won't be able to check it, but you won't lose it.

But, then again, the solution of MikeA may already be sufficient.

So I may not go with the suggestion of Stargate as they themselves are not sure if it possibly works. I am however, still thinking if I'll go for it. I need somebody (aside from MikeA of course, not that I don't trust him. Just want to be sure. ) to convince me that the solution that I am about to implement is indeed a correct solution. Anyone?

Thanks again.

:)

bitserve
12-17-2001, 01:10 PM
Isn't what mike suggested, the exact same thing that stargate suggested?

pmak0
12-17-2001, 02:36 PM
Here is a term paper that I finished earlier this month, entitled "Best Practices of Using Mirror Servers to Improve Website Reliability":

http://www.aaanime.net/pmak/gwu/cs233/project/project.html

It is not a step-by-step guide on how to set up a backup mirror server (so you'll need to have some background technical knowledge), but it explains the principles and suggests some open source tools that you might use to accomplish this.

imago-allan
12-17-2001, 06:59 PM
Not quite. What Stargate suggested is good for two domains. You set up URL forwarding from one domain to point to another domain and so on. While, MikeA suggests to simply use one domain and have it hosted by two different hosting company.

:)

Oh by the way, we almost lost customer who would like to order but our site went crazy yesterday. The tecnical problem I think is still being rectified.

mpope
12-17-2001, 10:06 PM
So I've been looking at cisco localdirectors and found this on ebay:
http://cgi.ebay.com/aw-cgi/eBayISAPI.dll?ViewItem&item=1309910138

Which, I don't think can be a load balancer, can it? I've tried to get information on this model, but haven't found anything yet.

It just seems like it is way too cheap!