Replicate Virtualmin between 2 VPS

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

I have two Ubuntu 20.04 that already has rsync configured in them. I installed Virtualmin and went though the initial install adding a virtual server.

What I need to do is mirror or replicate one VPS to a remote VPS and keep them up to date.
My next step would be to work towards a total failover from the main VPS to the replica should something happen. But for now I just need help using rsync to move everything from one Virtualmin VPS to the other and keep it up to date.
rsync -rtu home. root@111.111.11.111:/home. is not working an coping the virtual servers over of the databases.

Have you read about the daemon config? maybe that not setup correctly.

Not sure about the mysqld databases as well if they can be relicated like this.

you might be better using VM backup CLI and rsync the backup file.

What does rsync offer that a simple backup doesn’t already do.?
I have never really understood the difference.

Server1 is the point of truth it has perhaps 1000’s of clients making transactions through it at any point in time.
Server 2 is an identical copy of Server1 taken at a point in time.
Some monitoring mechanism? Switches DNS from Server1 to Server2 due to Server1 going offline?
But Server2 can never be guaranteed to be true - it is only a recent backup.

Just curious.

Well rsync only backs up files that have changed, not a full backup. The only issue is the database.

1 Like

rsync does more that backup files that changed.
rsync. -rtu
Moving a directory is simple. Add the -d option, and it will move only the directory. If you want to move the directory and its contents, use -r instead to recursively copy over all files and subfolders. While we’re at it, let’s tack on the -t option. This option will copy the date and time that the file was last changed. Using -t is good for keeping accurate records of when a file was last edited. These options will work with pushing or pulling. and the u:
The -u option tells rsync to update only different/changed/added files from the SOURCE to the DESTINATION .

I can use cron jobs to update every 30 min or what time frame I need as what I create was a web app that lets people create reports using any device connected to the internet and I need keep this data in sync in case of a cable cut or some other failure so I would configure a failover to the replica.

rsync can backup only the files that have changed or are new.

So all it really is only a different form of backup.
The name suggested to me it might be real synchronisation. Something that is very difficult.
There are other forms of simply making a copy to a different location.

You need to setup another MySQL and configure it to replicate with the master.
https://dev.mysql.com/doc/refman/8.0/en/replication.html

If you have MariaDB https://mariadb.com/kb/en/replication-overview/

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