LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 03-24-2007, 08:28 PM   #1
netdynamix
LQ Newbie
 
Registered: Mar 2007
Location: Johannesburg, South Africa
Distribution: Slackware, CentOS & Fedora
Posts: 6

Rep: Reputation: 0
Setting up my second box as a backup DNS and Database Replication


Dear Forum,

I have a server in the US which is acting as my primary HTTP, DNS, POP3, IMAP, SMTP and MySQL server for hosting...
I also have a server in South Africa... My home country which I wish to setup to act as a backup for all of the above services...

Especially DNS backup and Database Replication...

How????


Chris Grant
 
Old 03-26-2007, 10:04 AM   #2
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
The DNS backup is very easy, and the database backup is not much different. First though, a question. Do you want these backups to be functional, IE do you want the backup South African server to also be a DNS server, or simply to contain the files that the DNS server should have (IE the zone where yourdomain.com gets its address and mail exchanger set up)?

If you want a functional DNS backup, then install BIND on the South African Server, with it set as a slave to the master in North America. Go to your registrar, where you purchased the domain names that you use, and add the South African DNS server to the list of authoritative nameservers for your domain.

The named.conf on the slave should either be copied from one of the current slave nameservers, or if none exist, use this as a model:
Code:
zone "example1.com" in {
        type slave;
        file "example1.com";
        masters {North.American.IP.Address;};
};
zone "example2.com" in {
        type slave;
        file "example2.com";
        masters {North.American.IP.Address;};
};
Backups of a database prove tricky, only in that the database is changing, usually much more quickly than a backup could succeed at getting a full copy. The way to get around that is to dump the database to a static file, and then copy that file to the backup server.

Most databases have some of the functionality built into themselves, IE the creation of the static file. You can also use the cron utility to dump.

To transfer the dumped file, I suggest using the rsync, or rsyncd process. Rsync is great for large file transfers, as it only moves across the parts of the file that are different. To that end, I suggest you look into a utility called backuppc, which is available at sourceforge, http://backuppc.sourceforge.net and install it on the South African machine. That doesn't help to make the SA machine a functional DNS/database server, but it will be great for just holding the files, so if something goes wrong with the NA server, you can restore from these backups.

Peace,
JimBass
 
Old 03-27-2007, 05:56 AM   #3
netdynamix
LQ Newbie
 
Registered: Mar 2007
Location: Johannesburg, South Africa
Distribution: Slackware, CentOS & Fedora
Posts: 6

Original Poster
Rep: Reputation: 0
Thank you for your help mate...
You really know your stuff.

Thanks once again.

Chris
 
Old 03-27-2007, 09:51 AM   #4
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
No problem at all man. Since I don't code, I find helping here the best way for me to contribute to the community.

It would help others down the road if you post how you accomplish what you're trying to do. Once you get everything set, a simple "first A, then B" type closure will really help someone else in the same situation out in the future.

Peace,
JimBass
 
Old 03-27-2007, 05:02 PM   #5
netdynamix
LQ Newbie
 
Registered: Mar 2007
Location: Johannesburg, South Africa
Distribution: Slackware, CentOS & Fedora
Posts: 6

Original Poster
Rep: Reputation: 0
Excellent... I will be sure to post once I have finished everything.

One more question though. I now have a third server in the equation... with regards to DNS only, I take it that I just set the third server up as a slave of the first as well, right?

I have forgotten one of the main important services running on my first box. I am running Exim on the Primary server and SendMail on the second and third. Mainly because it came with the default installation of the distributions running on the second and the third.

I want to set the second server (and if that fails, the third server) to keep mail in a spool if the primary server goes offline. So that effectively when the primary server comes back online the MTA on the second (or third) server will delivery it to the primary server.

I hope that I explained that effectively.
I have never done a migration from SendMail to Exim on a machine already running SendMail, so it is new territory to me... I am not sure if it is a simple process or not???

If it is going to be easier to keep SendMail on the second and third servers and just set SendMail to spool, then i'd rather do it that way.

Jim, if you could help me with this little issue then you are a God amoungt men as far as I am concerned!!
 
Old 03-27-2007, 08:19 PM   #6
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 48
What you are saying makes perfect sense, and is a very common setting. I don't play with sendmail myself, I use qmail and exim4, but it makes little difference. Here is what you need -

In the DNS for the domain (names changed to protect the guilty):
Code:
 
3600       IN         MX        10 primary.domain.com.
3600       IN         MX        20 secondary.domain.com.

(and below)
primary        IN         A         I.P.Add.Ress
secondary      IN         A         I.PA.dd.Ress
That sends all mail to the primary, unless it can't be reached, in which case it goes to the secondary. The secondary needs to be configured simply to hold the mail until the primary goes back online. That is covered for sendmail in this page -
http://servers.digitaldaze.com/exten...condarymx.html

Don't worry that it is for a virtual server and exchange, it makes no difference what the primary server is. That is a function of the mail exchanger software, not DNS really, beyond setting the preferences in the DNS.

As to the DNS, yes, you could simply copy the named.conf file from the current slave, and run with that on the new server. You may need to add the new slave's IP address to the configuration on the primary DNS server, depending on how it handles the slaves.

Peace,
JimBass
 
  


Reply

Tags
backup, dns, replication


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Setting up a network with a Suse box & a Windows box flatstan Suse/Novell 21 03-15-2007 08:11 AM
PostgreSQL database replication just by transfering/mirroring the files saumitra Programming 6 03-07-2007 06:35 AM
Run my own backup DNS server, ISP DNS not available chrismcnally Linux - Networking 3 07-30-2006 09:20 AM
LXer: How To Set Up Database Replication In MySQL LXer Syndicated Linux News 1 06-23-2006 09:53 AM
database replication software test111 Linux - Software 1 08-30-2005 09:02 PM


All times are GMT -5. The time now is 01:11 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration