7

i am a student so i am pretty new at this but i am making a web cluster with two web servers so that if one server fails the website still stays up. my question is how do i assign a virtual IP address to both machines so that I have one IP address to handle all incoming requests? both machines are running ubuntu 9.04

2 Answers2

5

Do you want a failover cluster or a load balancing cluster?

Failover cluster: only one server gets the "virtual" IP address and handles incoming requests; if it fails, the other one becomes active in its place; there is only one web site active, so it needs no special tweak to run this way (but you should take care to only have data in locations accessible by all nodes); this setup is usually achieved at the O.S. level.

Load balancing cluster: both servers share a single "virtual" IP address and handle requests; the web site needs to be designed to handle multiple simultaneous instances (no local content on servers, proper session management, etc.); this can be achieved at the O.S. level or using a dedicated hardware load balancer in front of the web servers.

The load balancing cluster is the usual setup for web farms.

Massimo
  • 68,714
  • 56
  • 196
  • 319
  • I am doing the load balancer cluster. this is the tutorial i'm using http://www.howtoforge.com/set-up-a-loadbalanced-ha-apache-cluster-ubuntu8.04 thanks for the help!!!! –  Dec 16 '09 at 18:40
  • any ideas? I'm really stuck on this –  Dec 16 '09 at 19:52
  • **Where** and **why** are you stuck?!? That's a pretty thorough tutorial... – Massimo Dec 16 '09 at 20:20
  • i setup the /etc/network/interfaces file as shown in the tutorial (with my ip address of course) but the virtual ip address does not resolve to anything when i type it into the url –  Dec 16 '09 at 20:24
  • What about a failover + load balancing cluster? – CMCDragonkai Jun 14 '14 at 08:37
0

You have several options depending on what you are trying to accomplish.

LVS with keepalived is a good load balancing solution: http://keepalived.org/ heartbeat might also be an option: http://www.linux-ha.org/HomePage

rorr
  • 622
  • 4
  • 8