0

I am new to web based apps.. my requirement is that a user accesses a URL that can be served by two servers- Primary and Secondary.

When Primary goes down,the requests of that URL should automatically be forwarded to the secondary server so now it serves in place of the Primary (and as soon as Primary resumes,it becomes the server for all incoming requests again). How can this be achieved?? Is there going to be a script that is going to serve the purpose for me?? and where is this script going to be run?

What approach shall i take.. please share some inputs..

Thanks.

phoebus
  • 8,430

2 Answers2

1

What operating system are you using?

Two common ways of doing this are with load balancers and with clusters.

The most drop-in method would be to place a hardware load balancer in front of the web servers. The LB would detect when service is down on a node, and redirect traffic to the other node. There are also many methods of software HA/load balancing.

With clusters, the servers have heartbeat connections and other methods of detecting service availability. In an active/passive cluster, as you seem to be talking about, one server would be the active node, and if it failed, the other server would take over services. There is no need for IP changes because the cluster uses one virtual IP for external availability.

Here is an SF question related to doing this stuff with Apache/Linux.

phoebus
  • 8,430
0

DNS failover can be useful in some limited number of cases. See Why is DNS failover not recommended?