Hi,
I host a number of smaller websites on a Linux Cpanel VPS, and am looking into setting up a live mirror in a different datacenter. So far I understand this to require the following elements:
1. setup two identical servers (with at least the same software)
2. setup a dns failover, so that when the primary server becomes unavailable, it sends the traffic to server two.
3. setup dns synchronisation between the two cpanel servers
4. use rsync to sync the /home folder from server 1 to server 2. (like here)
5. setup mysql master-slave replication between server 1 and server 2. (like here)
(I gave the tuto's in the hope of perhaps helping others)
Now my questions, if you please:
1. Why should I use dns failover, and can't I simply have my 1st and 2nd nameservers point to server 1, and the 3rd and 4th to server two? This should ensure a seamless transition when server 1 becomes unavailable. But am I missing something here?
2. I'm wondering what to do with changes made on the second server, while the first one is down. For changes in the database (i.e. orders in a webshop), I guess I could setup a mysql master-master relationship (like here), but what if file changes are made on server two (i.e. the site owner updates a product image) is there any way to transfer those to server 1 when it becomes available again?
Can anyone please shed some light on my questions? Maybe I'm going about this in totally the wrong way, I'd love to hear that too.
Thanks!
David
I host a number of smaller websites on a Linux Cpanel VPS, and am looking into setting up a live mirror in a different datacenter. So far I understand this to require the following elements:
1. setup two identical servers (with at least the same software)
2. setup a dns failover, so that when the primary server becomes unavailable, it sends the traffic to server two.
3. setup dns synchronisation between the two cpanel servers
4. use rsync to sync the /home folder from server 1 to server 2. (like here)
5. setup mysql master-slave replication between server 1 and server 2. (like here)
(I gave the tuto's in the hope of perhaps helping others)
Now my questions, if you please:
1. Why should I use dns failover, and can't I simply have my 1st and 2nd nameservers point to server 1, and the 3rd and 4th to server two? This should ensure a seamless transition when server 1 becomes unavailable. But am I missing something here?
2. I'm wondering what to do with changes made on the second server, while the first one is down. For changes in the database (i.e. orders in a webshop), I guess I could setup a mysql master-master relationship (like here), but what if file changes are made on server two (i.e. the site owner updates a product image) is there any way to transfer those to server 1 when it becomes available again?
Can anyone please shed some light on my questions? Maybe I'm going about this in totally the wrong way, I'd love to hear that too.
Thanks!
David