I currently have a VPS hosted in Charleston, NC. My current provider is offering a deal to purchase an identical (resource wise) VPS in another data center. Although I rarely experience downtime, I would like to purchase the other VPS and set it up as a hot spare to take over automatically in case of a failure of the VPS in Charleston.
My server runs provides my clients with a web server (apache), a database (mysql), a mail server (postfix + courier), and DNS (bind9). The OS is Ubuntu Server 11.04
How can I setup the additional server to it automatically functions as a failover, and how can I keep everything in sync.
Well, there are literally very many tools for migrating the configurations over. However automatic fail-over and maintaining live replicated data are a hard thing to achieve.
For the former requirement, ie configs, If I don't have a configuration tool such as chef (which would seem inappropriate in your case) I just install webmin on both nodes, and backup the configurations using the tools.
webmin has a cluster manager which is useful, but rsync, cron or various system imaging tools are available.
The hard part for a "hot" backup is the data in mysql and any user data in postfix, and whether you actually want to hot replicate that.
if you really need a hot failover...
I would look into mysql replication, to maintain the database you might look at monit, heartbeat or stonith tools to handle automatic failover. also the MMM tool is popular, but my experience with it is mixed.
Since your two servers are going to be in different datacenters, you will need to rely on changing DNS entries to point to the new servers.
Many clustering and failover systems rely on having a virtual IP - one that either system can take over by sending out arp broadcasts to tell the switch to start sending the traffic to them.
In seperate datacenters, you can't have one IP that can be routed to both servers.