LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-14-2005, 12:50 PM   #1
exodist
Senior Member
 
Registered: Aug 2003
Location: Portland, Oregon
Distribution: Arch
Posts: 1,374

Rep: Reputation: 47
redundant web servers


The small business I work for is fed-up w/ the local isp's and various e-mail limits. We have our own domain name, and our e-mail is at the domain name run by a small isp in our rural area.

I am a linux admin with many years experience in linux administration, using apache and other web services. I dabbled lightly in lan dns a while back.

What I want to do:

We want to setup 2 redundant servers in alternate locations, one here in our main office, and the other at one of our homes (seperate internet, power grid, etc.).

I am confident I can configure the web services such as apache and postfix on each no problem. I am also confident I could configure a dns server that resolves our domain to the server at eather location. but I am not sure how to go about the next step:

We want the server at the promary location to be the dns and web server all the time, any requests go there. We want the second server to simply duplucate any data on the main server and listen, if the main server goes down and cannot be reached any longer the second server should kick in, replace the dns records so that any e-mail or web requests are sent to it instead, then when the main server comes back online the secondary one should send the primary one all the e-mail it recieved and then give the main server back it's responsibilities (replace dns record again, etc)

Now I can easily setup monitoring and scripts to duplicate data, the only thing I am not sure how to do in this setup is the dns part, making the name resolve to the ip of the backup server instead of the main server, then switching back later.

do I need to setup the dns to list both servers in a sequence so that incomming connections will try the first then go to second if the first is not reachable? sounds to me this would be the best option, but I am not sure if it is possible, as I said my dns experience is limited.

I understand the theory of dns, and how it does it's job, I am familiar w/ domains and such. I am just not familiar w/ the tools and behaviors of various configuration as far as implimentation goes (the qandry of theory vs. implimentation)

Thank you in advance for any assistance.
 
Old 11-14-2005, 05:15 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
We want the server at the promary location to be the dns and web server all the time, any requests go there.
...so that when you loose connectivity to primary, you'll not only loose HTTP (trivial) but also your primary DNS (critical) as well. Hurrah!


We want the second server to simply duplucate any data on the main server and listen, if the main server goes down and cannot be reached any longer the second server should kick in, replace the dns records so that any e-mail or web requests are sent to it instead,
For email just add multiple MX records. Any sane remote MTA will figure out all by itself where can drop mail.
HTTP shouldn't pose problems either, just set up a share and replicate.
I don't think replacing DNS records will work as you described because you choose to host the primary *yourself*. I would think that if you own two "local" slaves and leave the master at your ISP, then you could "advertise" your www CNAME using the first slave, and when it dies increment the serial so the second slave pushes the record to the master, but then I ain't no DNS guru.
 
Old 11-14-2005, 06:00 PM   #3
exodist
Senior Member
 
Registered: Aug 2003
Location: Portland, Oregon
Distribution: Arch
Posts: 1,374

Original Poster
Rep: Reputation: 47
ok, a sane config will cycle mx records and drop mail wherever it works, that is the main issue I had e-mail is out priority. so that means I can go with a dns service I do not have direct system control over. as for http, that was not clear, does anyone know if I can list 2 www.xxx.tld and have it try them in order? or will this simply do the round robin I have heard of alternating the 2?

also for any dns guru's, same issue of round robin but on mail yes or no?
 
Old 11-15-2005, 12:33 AM   #4
Snowbat
Member
 
Registered: Jun 2005
Location: q3dm7
Distribution: Mandriva 2010.0 x86_64
Posts: 338

Rep: Reputation: 31
RFC 1035 was written back in 1987, four years before the first web server went public and at least six years before anyone thought of a web server as an essential service. Sites such as www.google.com and www.microsoft.com point to multiple aliases but I don't know if all browsers will treat that as a fallover list.

What you could do is set the TTL for your www subdomain to something rediculously low (dyndns.org sets 60 seconds for user subdomains) and run scripts to monitor connectivity and update the www A record on your primary and secondary DNS as necessary. This technique will generate a lot more DNS query traffic for you and slower load times for your visitors though, since the A record will become essentially non-cacheable.

For your mail exchangers I suggest you use the existing mechanism within DNS.

Last edited by Snowbat; 11-15-2005 at 12:46 AM.
 
Old 12-19-2005, 06:21 AM   #5
lucky_luuk
LQ Newbie
 
Registered: Aug 2005
Distribution: Fedora Core 4
Posts: 19

Rep: Reputation: 0
I am looking for the same features as Exodist, specifically for the Apache webserver.
Is there no function available like the MX priority for other requests, like an A record?

I do understand the technique of a script checking the server activity, update the A records, and a low TTL. I am using BIND with a MySQL database and that sounds relatively simple (although I have to look for the best way how-to do it as I never did it).

Does this work however if I am hosting the DNS myself as well and it was mentioned that losing the primary DNS is fatal. Will a request be routed past all servers listed as DNS server for the domain until it gets a proper response? The second DNS server will in this case have a changed record after detecting the primary went down.

Thanks!
 
Old 12-19-2005, 02:16 PM   #6
Snowbat
Member
 
Registered: Jun 2005
Location: q3dm7
Distribution: Mandriva 2010.0 x86_64
Posts: 338

Rep: Reputation: 31
Losing your primary DNS is not fatal if your secondary is fully functional. When the specifications for DNS were written, email and DNS were considered important enough to allow for redundant hosts, but web servers were not considered because they did not exist in 1987.
 
Old 12-21-2005, 02:09 AM   #7
lucky_luuk
LQ Newbie
 
Registered: Aug 2005
Distribution: Fedora Core 4
Posts: 19

Rep: Reputation: 0
Thanks Snowbat, I think that will do for me than.
I will start thinking about how to actually program it!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
redundant qmail servers (primary & secondary) littleking Linux - Networking 3 08-15-2004 10:18 PM
Redundant Linux Servers mephitic Linux - General 3 07-13-2004 12:33 PM
adding more web servers to make web server farm linuxboy69 Linux - Networking 5 07-09-2004 09:50 AM
Redundant Proxy Servers or Clusters alasdair247 Linux - Newbie 0 10-01-2002 05:30 AM
2 web servers hawkes Linux - Networking 3 05-24-2001 10:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration