0

I'm looking to setup cheap redundancy for a website, such that I signup with 2 separate shared hosting accounts. The likelihood of both being down at the same time would be small.

Is there a way to point my domain (e.g. domain.com) to both my hosting accounts where server 1 (if active) is a primary and would normally handle all requests and server 2 is a fall back when server 1 goes down? i.e. The domain name would look to resolve to the primary server and if down then check the secondary server.

I'm not too clued up on DNS, servers and likes, so perhaps my suggestion above may be naive and if so is there a preferred way to do something like this?

1
  • In my opinion, you should need to have some hardware to redirect (if need be) traffic to other machine. I've thought about two A records for your domain, but it's not good idea - link
    – dave
    Aug 28, 2012 at 11:04

2 Answers 2

1

DNS is not suited to HA solutions since there is no preference or order in the records returned; i.e. if you have two A records for the same site, both will be returned at all times, and you cannot determine which one is used at any given moment.

That said, it is possible using ddns (dynamic DNS updates) to switch the hostname to a different IP if some condition occurs; this needs to happen either outside the machines that provide the service (thus requiring a third machine), or it needs to happen on both machines simultaneously (so whichever one is alive "wins", so to speak)

0

You can setup two A records for the domain you intend to use but the drawback here is that when resolving it might go to the site that might be down at that time.

A better way is to get 3 cheap VPS servers and make 2 of them host the site and the third act as a load-ballancer, after which point the domain you intend to use to the load-ballancer. Or just one VPS that will act as a Load-Ballancer between the 2 domains on the shared hosting.

If you want to make it with even more availability, you should setup two load-ballancers with heartbeat which will switch the IP to which the domain is pointed from one LB to another in case the first one fails.

2
  • 2
    How does adding a third single-point-of-failure to two HA machines make the whole thing MORE available ?
    – adaptr
    Aug 28, 2012 at 11:07
  • Agreed. You'd really need to make it a clustered set of load balancers.
    – MDMarra
    Aug 28, 2012 at 11:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .