I'm planning a backup data center and want all external hosts to transparently connect to DC2 if DC1 goes down. Assume I have public ip 1.1.1.1 at DC1, and public ip 2.2.2.2 at DC2.
Obviously if external hosts connect directly to 1.1.1.1 they cannot transparently switch over. So I thought of using public ip address 3.3.3.3 for the 'active' DC for external hosts to connect to, and a router somewhere in front of the two DC's which will route 3.3.3.3 to either 1.1.1.1 or 2.2.2.2
Now the hard part. do I have to put a router colocated at an ISP and update routes in that box? (Using DNAT perhaps to change 3.3.3.3 to X.X.X.X)? Do ISP's offer an automated way to update routes in their routers? A better way?
You're getting into some really difficult problems here :)
First question you have to ask yourself is what happens to your data when the primary fails. I'll forget about that for now. Second question is what happens to already-connected TCP streams. "Transparent" would imply that they stay connected, which would almost need you to have active-active datacenters.
If you have the same (and really professional) ISP at both datacenters, you can route IPs to one datacenter or the other using (usually) BGP. This needs full cooperation from your very high-end ISP and usually their management of the front-end router at your data-centers.
One "poor man's" solution is to have short TTLs, NS at both datacenters, and the backup DC NS change to backup IPs when they detect that the primary is down.