Reduncy/Failover for Websites

Discussion in 'Web Design & Coding' started by kcnychief, Feb 25, 2007.

  1. kcnychief

    kcnychief █▄█ ▀█▄ █ Political User Folding Team

    Messages:
    16,948
    Location:
    Massachusetts
    Due to the crap I went throug last week, I'd like to look into setting up reduncy/failover for at least one of my sites and perhaps more.

    If the site in questions is something like www.site1.com - I would ike www.site2.com to resolve in the event that www.site1.com is having issues or is overloaded (second probably won't happen, but just incase.)

    How would I go about setting that up?
     
  2. X-Istence

    X-Istence * Political User

    Messages:
    6,498
    Location:
    USA
    You want to failover DNS server. This can be accomplished two ways.

    One is having DNS servers in two locations, hoping the client always sees the first NS as being up and always using that, and thus only when that is down accessing the second, or you could do multiple IP's for the same name, in which case it is basically round robin, the client can pick one or the other (normally it will go down the list, so your main host will get picked first, not a guarantee)

    Or even better, you could find some really reliable hosting that does not require you to do these sort of things.
     
  3. kcnychief

    kcnychief █▄█ ▀█▄ █ Political User Folding Team

    Messages:
    16,948
    Location:
    Massachusetts
    It would be nice to have reliable hosting, but I still want to plan for the worst :D

    If I do two IP's for the same host, how does it know to go to the second one?
     
  4. X-Istence

    X-Istence * Political User

    Messages:
    6,498
    Location:
    USA
    All browsers will first try the first IP, after that times out (15 or so seconds) it will try the second, after that it will always try the second for as long as the IP is in it's cache.
     
    kcnychief likes this.
  5. kcnychief

    kcnychief █▄█ ▀█▄ █ Political User Folding Team

    Messages:
    16,948
    Location:
    Massachusetts
    Interesting, thank you very much. I'll get right on it.
     
  6. fitz

    fitz Just Floating Along Staff Member Political User Folding Team

    Messages:
    4,076
    Location:
    Chicagoland
    actually, no..

    if the dns server is working properly, a Round Robin configuration will rotate the IP address returned.. this is one of the reasons round robin DNS works as a Load balancing technique.

    edit:
    Caching does change things slightly.. if a end user queries on the address, his DNS server may have a cached answer of the first IP address, so, the end user will always get that IP address in his DNS query until the cache times out.
     
    Last edited: Feb 26, 2007
  7. LordOfLA

    LordOfLA Godlike!

    Messages:
    7,027
    Location:
    Maidenhead, Berkshire, UK
    We use load-balancers and some fancy multi-switch multi-uplink stuff for our HA clients. 2 load-balancers, 2 dedicated switches and 2 network cards on each machine connected to the switches.
     
  8. fitz

    fitz Just Floating Along Staff Member Political User Folding Team

    Messages:
    4,076
    Location:
    Chicagoland
    Not sure how he would fail over between different hosting providers.. he would need to find a way to work with the different hosting providers and make them work together to achieve something really nice (good luck with that! :) )

    edit: Lots of places (like LordofLA) will offer a HA account that includes clustering. Having not really followed the 1and1 thread all that closely, I don't know what the cause of the outage was. Depending on the provider, some host providers will provide a disparate geo cluster of machines in different geographic regions which would provide a lot of protection of a single datacenter going down hard if done correctly. I have no idea of a hosting provider would be willing to provide a failover to a different hosting provider though.

    edit2: I suppose, in theory, if you control your own DNS records, you could write/purchase a monitoring script that monitors the primary site and when it goes down, updates your DNS record to point to the backup site. You would still have a delay due to DNS Caching and such though..
     
    Last edited: Feb 26, 2007
  9. kcnychief

    kcnychief █▄█ ▀█▄ █ Political User Folding Team

    Messages:
    16,948
    Location:
    Massachusetts
    What I have decided to do is stick with 1and1, and get a VPS package - I will have much more control. Great info though guys, thanks - I may try to implement some of it. I will have control over DNS entries, but I agree the caching will be a factor and I hope the sites will be responsive before it would need to update the cache in 24-48 hours?