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

General Discussion of atomic repo and development projects.

Ask for help here with anything else not covered by other forums.
bananapar
Forum User
Forum User
Posts: 38
Joined: Fri Jul 23, 2010 10:03 am
Location: UK

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

Unread post 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.
Highland
Forum Regular
Forum Regular
Posts: 674
Joined: Mon Apr 10, 2006 12:55 pm

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

Unread post 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.
"Its not a mac. I run linux... I'm actually cool." - scott
bananapar
Forum User
Forum User
Posts: 38
Joined: Fri Jul 23, 2010 10:03 am
Location: UK

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

Unread post 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.
Last edited by bananapar on Fri Jul 01, 2011 9:52 am, edited 2 times in total.
Highland
Forum Regular
Forum Regular
Posts: 674
Joined: Mon Apr 10, 2006 12:55 pm

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

Unread post 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.
"Its not a mac. I run linux... I'm actually cool." - scott
BruceLee
Forum Regular
Forum Regular
Posts: 879
Joined: Sat Mar 28, 2009 6:58 pm
Location: Germany

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

Unread post 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=
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

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

Unread post by scott »

Yup, we use multiple A records pointing to a single domain (updates.atomicorp.com) for "diet coke" load balancing now.
Post Reply