Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

suppose you only have 2 servers, would you like to place a web server on each. You want webserver X to be primary and serves all the request at all time unless it is down, at which time Y should kick in.
No load balancer is allowed to since it would not increase availability(it would have to sit on the same server as X and would likely be down if X is down).
Both X and Y service request via the same host name of course. is this possible?

share|improve this question

migrated from stackoverflow.com Jun 5 '11 at 16:47

This question came from our site for professional and enthusiast programmers.

    
The machine is called host, the program is called server(web server etc). On a single host you can have many servers! –  Bakudan Jun 5 '11 at 16:46
    
@Bakudan: "server" is a perfectly cromulent term for a machine. –  Wooble Jun 5 '11 at 17:07

3 Answers 3

Use keepalived. Configure each host with a distinct IP, then configure a shared IP in keepalived. Point your www DNS record at the shared IP.

share|improve this answer

Several ideas popp to mind. You'll have to research them to figure out which fits your situation the best, as I'm missing some information which would factor into it.

CARP - Good if you're running FreeBSD or OpenBSD. I think that a variant is ported to Linux, but is implemented in userspace instead of at the OS level. I'm not positive. You can get some good details in the FreeBSD handbook, if you're running that. See also HAST for file synchronization.

Reverse proxy - You can use this feature in apache or squid. Bsically, you have web server X and reverse proxies Y and Z. Then X has the authoritative data and requests to either Y or Z will cause them to ask X for the data. I use this to put a firewalled Mac mini on the Internet and have it dish out content from some proprietary/embedded Windows services. Then vulnerabilities in Windows become less of an issue. So in my case, it's more about security and my lesser skills are securing Windows. However, I've heard of some people using this to make "load balancing."

IP - If you don't mind having to do this manually, you can always just reconfigure the IP of the second server to become the first. Not elegant or quick, but cheap and somewhat easy. CARP (see above) is effectively an automation of this. You may even be able to use a mix of cron, shell, and ping to vaguely simulate this.

Load balancer hardware - I've heard of this from people with bigger systems than the one I administer. I don't know a lot about it, but it's out there.

Hope that helps.

share|improve this answer

This can be accomplished by setting up Round-robin DNS witch works by responding to DNS requests not only with a single IP address, but a list of IP addresses.

share|improve this answer
    
I'm not sure that this will work. Any given client will cache the FQDN resolution and then go to just that one server for the next 24 hours (or however long the DNS cache period is.) That doesn't deliver a very quick switch to the still-live server. In fact, when the cache expires there is no guarantee that the next DNS query will go to the still-live server. I could be wrong, but I always thought that round-robin DNS was always about load balancing and not fail-over or redundancy. –  Data Scavenger Jun 5 '11 at 21:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.