Page 1 of 1

Setting up a server as secondary/backup for hosting and mail

Posted: Wed Jun 15, 2011 9:50 am
by bananapar
We have two servers; both are running plesk on CentOS 5.
Server sA is new and we have just migrated all the hosting and mail to that one. Server sB is the old one.
We want to be able to use sB as backup for sA incase for whatever reason a problem arises with sA.
I already know that we can have a mail backup using qmail with smptroutes and morercpthosts on server B.

The main issues we are unsure of are:
1. How best to set up DNS so that B hosting is only in use when A is down?
2. The best way to keep data on B is as uptodate as possible and how often should we update it?
3. Is there a way we might be able to keep plesk control panel on B without having to pay for two licenses?

For item 2 I am looking into linux-ha and I think it would be reasonable to update once a day in the early hours of the morning.

Any input would be much appreciated, thanks.

Re: Setting up a server as secondary/backup for hosting and

Posted: Wed Jun 15, 2011 11:17 am
by Highland
1. Your MX records are weighted. So, for example, you would put sA at a weight of 10 and sB at a weight of 20. This would send mail to sB only when sA was unavailable.
2. You could use rsync to accomplish this. Set it up using an unkeyed SSH key and just have it run every 6 hours and sB can pull files from sA.

Re: Setting up a server as secondary/backup for hosting and

Posted: Thu Jun 16, 2011 6:30 am
by bananapar
Thank you for your answer Highland.
We have used rsync before but I'm looking to see if other options give us more flexibility/managability.

We are already pretty sure what we need to do for email backup. It's access to websites, etc that we are less sure of.
Some sites are database driven and would change a lot on a day to day basis; thus we don't want people going to both servers but instead would like sB to only be looked at if httpd on sA (or the whole server) is down.
We are not sure how to do this as you don't seem to be able to weight NS or A records.

Re: Setting up a server as secondary/backup for hosting and

Posted: Thu Jun 16, 2011 8:09 am
by Highland
Well, A records are, by definition, exclusive. MX records realize you might need multiple mail servers and are the only DNS record that is weighted.

The only way you could set up a website to do failover would be to use a load balancer. The load balancer could detect sA was down and send traffic to sB. Some hosts (I know SoftLayer does) offer a shared load balancer, which is far cheaper than owning another machine.

Re: Setting up a server as secondary/backup for hosting and

Posted: Fri Jun 17, 2011 3:03 pm
by BruceLee
Well, A records are, by definition, exclusive. MX records realize you might need multiple mail servers and are the only DNS record that is weighted.
The only way you could set up a website to do failover would be to use a load balancer.
I'm sorry but that's not correct. You can set multiple resource records into one resource record set for example one entry like www with roundrobin. So it is possible to achieve some sort of load balancing via DNS based load balancing.
Extending this with healthchecks if the corresponding server is available and if not change the config automatically is a solution that is used quite often for financial reasons since you don't need additional load balancing equipment.
Of course this solution is primitive and not capable for all scenarios but it works.
bind is the first address to achieve this.

http://ftp.isc.org/isc/bind9/cur/9.8/do ... v9ARM.pdfl

http://www.google.de/search?source=ig&h ... =&aql=&oq=

Re: Setting up a server as secondary/backup for hosting and

Posted: Fri Jun 17, 2011 4:09 pm
by scott
Yup, we use multiple A records pointing to a single domain (updates.atomicorp.com) for "diet coke" load balancing now.