How to set up HA cluster or Primary - Secondary for DR

SYSTEM INFORMATION
OS type and version Ubuntu 20.04
Webmin version 2.021
Virtualmin version 7.7
Related packages

I’ve got a couple of Ubuntu 20.04 VPS servers running Virtualmin 7.7. They’re on different ISPs. Currently one is used for NGINX web, Postfix/Dovecot email, mySQL database and primary dns duties while the other is a lower specced server running secondary DNS. The secondary DNS is configured as a Webmin Server in the primary server and the two servers are set up as a DNS cluster in a primary/secondary configuration. They both run CSF.

The primary server has a few tweaks and additions but is not heavily modified, the secondary server is pretty vanilla.

While they’re both backed up using Virtualmin’s built-in Backup Virtual Servers functionality to S3 buckets, and I have a cloud backup solution for the /home and /etc directories, I’d like to see if there’s a good method to set up a full HA cluster or near real time primary - secondary failover system.

I’ve seen some posts on setting up an HA cluster but this requires using a single source for the file system and I’m not sure that’s practical/possible if I’ve got the 2 servers running on separate providers.

So instead of a proper HA cluster I was wondering if it’s possible to set up a near real time DR failover system. I think this will require a one (or two) way file sync using something like rsync, a replicated database, etc. I’m not sure the best way to do this as at the moment I don’t have specific knowledge for what needs to be backed up and restored from primary to secondary in terms of Ubuntu directories / files in order to make sure that the changes on the primary get transferred to the secondary. This also ties in with me wondering if it’s possible to something like a BMR on the secondary (or any other VPS or even a Ubuntu VM in my office).

If anyone has got an operating setup along these lines I’d love to hear about it.

Thanks!

As both servers are running the same OS and version, and assuming they have the same application stack, I would suggest looking at lsyncd for file/folder replication - it’s fast and reliable, although it uses quite a bit of memory if you have a large number of files and folders.

That would handle your web files.

You can use database replication to keep your DBs replicated

Trickier bit is email, but looks like Dovecot have dsync - that might be the way to do it?

I’d suggest some sort of a load balancer / proxy that sits in front, so you can switch between the two servers.

Your DNS is already set up with the primary/secondary DNS servers, however I’d also suggest a DNS server outside of your infrastructure.

It’s certainly not a trivial task to set this up. I use Cloudmin on bare metal servers and this can handle the server level replication as you’re running the VPS instances yourself, but in general it does come down to specific configurations for each group of VPS instances you want to have in some sort of load balanced or fail over configuration. Replicating whole servers is quite expensive, it’s much better to just replicate what you need to.

Hope that helps a bit!

1 Like

Thanks for the reply and links to those tools. I’ll take a look into them and see if I can set up a DR solution with them.

Is there any documentation In terms of files that need to be synced in Virtualmin in order for the conf and data to be reliable across the 2 systems? Assuming that Dovecot, DNS and Database data sync is already taken care of by their respective tools.

I saw that there’s a Webmin Clustering tool but it’s not really what I’m looking for.

I have file backup to cloud in place already but I’m not sure what files and directories need to be in the backup plan in order to restore to a vanilla Ubuntu install so that all the Unix users, applications, configs, etc, etc are all set up. Anyone know if that’s even possible?

Thanks again for any input.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.