Second Directadmin Server backup question

netforce

Verified User
Joined
Dec 28, 2004
Messages
7
Hello,

I ve restored all users under resellers to another server that is running Directadmin also, so as to have a backup server in case of emergency.

The problem is that there are users that first reach the secondary server instead of the first one even if the main server is online and working properly.

As a result mail goes to the secondary server and users can't get it (or loose it) except if they change the pop3 of the server to the ip of the backup server. This is not a good solution.

How could i avoid this from happening?

Thank you in advance for any suggestions.
 
I can't answer this question until you explain your DNS setup (do you have both A records, etc., for each site?) and also whether or not you want your users to be able to get their email even if/when the main server is down.

Jeff
 
Well, I had decided to acquire another server, and run direct admin as a backup solution. So in order to utilize such technique I want some advice from you as well.

Consider the following scenario. There's the primary server running all the clients' websites. Now there's a second server less powerfull but meeting the requirements for having each client up and running in any case the primary goes down for maitenance or due to a technical fault / network inavailability.

Now what we need:

a) To synchronize the webcontent and the MySQL databases of the primary and the secondary system once per day. (Thus to have the data transfered from the primary to the secondary one).

b) Both servers should be able to receive e-mail for our clients, since some of them, have no chance of loosing any important mail.

c) Somehow the clients should be able to receive incoming mail from both machines to their local computer, preferably without so much frustration.

d) The backup machine, won't have so many IPs available, thus a few clients won't be able to run their SSL site in there, as long as the primary system is down, but anyway, thus won't hurt too much. In the near future we may add more IPs to the second machine, in order to short this problem out.

Now what I need from you is some instructions. Since in both machines I would have root access, I suppose any DNS tricks, which you are going to advice, there won't be a problem

Thanks in advance ...
 
netforce said:
a) To synchronize the webcontent and the MySQL databases of the primary and the secondary system once per day. (Thus to have the data transfered from the primary to the secondary one).
This is not a simple thing to implement.

Here are some directions to look in...

You can use a MySQL cluster to keep databases on multiple servers in sync. You can use rsync or tar to copy files between servers.
b) Both servers should be able to receive e-mail for our clients, since some of them, have no chance of loosing any important mail.
You cannot send mail to both servers; you can let the sending servers decide which one to use by having two MX records; one for each machine, with the same priority number, so both machines will get mail, or you can have just one MX record, to the main machine, and change DNS if/when that machine fails.
c) Somehow the clients should be able to receive incoming mail from both machines to their local computer, preferably without so much frustration.
If you use two MX records (above) then each user will need to read email from both servers all the time, and they'll have to run clients which won't cause local errors if one of the servers won't reach. For that reason you might want to use the single MX method, even though it could result in undeliverable and/or delayed email under circumstances.
d) The backup machine, won't have so many IPs available, thus a few clients won't be able to run their SSL site in there, as long as the primary system is down, but anyway, thus won't hurt too much. In the near future we may add more IPs to the second machine, in order to short this problem out.
Then don't even put regular content into the private_html directories, but rather a placeholder that says something like "secure site temporarily down; try again later".
Now what I need from you is some instructions. Since in both machines I would have root access, I suppose any DNS tricks, which you are going to advice, there won't be a problem
Use a very low TTL, perhaps 300 to 600 (5 to ten minutes). Run both machines as nameservers. Run a script on the backup machine that keeps checking the heartbeat of the master machine, and that changes DNS records if the master fails.

Or alternatively, if the main machine fails, the heartbeat monitor can change the IP#s of the backup machine, and restart the network.

However, if you use the latter method you'll have two issues:

1) DA doesn't use the standard method for adding IP#s; you'll have to call the DA script as well as the OS script, for adding IP#s.

2) You won't be able to reach or restore the failed machine if all it's IP#s are now being served on the backup machine.

Jeff
 
Hi again,

What I was thinking actually is to have two separate licences of DA, one for the main and one for the backup system (having installed the same type of OS), the content would be served (possibly) by using some dns trick to fool the www record ... or hmm I think I have found a possible solution.

I would need to have two named.conf files (for each machine), which actually would point to two different setups. So when the primary machine fails, what I would have to do, is to point the named to the second config dir, where actually different A records do exist.

Having a DNS timeout of 5 mins, that means it would be possible to switch, the sites ASAP and continue the maintenance having only the DNS service running on the faulted machine.

Then a switch in the named.conf and everything's back to normal ...

Let me know the possibility of that scenario please ...
 
Back
Top