Server migration: sync directory

Posted on

Server migration: sync directory – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about linux, ubuntu, centos, filesystems, .

We are currently migrating our servers over to a new platform and I need to keep 2 directories over 15Gb each in sync while testing/migrating services over to our new platform.

I have thought of using rsync to keep them uptodate however this would take a long time and only be uptodate at the time of running and I need this to be in realtime or as close to as possible!

If anyone could help would be greatly appreciated!!

Our current system is running ubuntu and our new one is running centos 5.5

Solution :

You could do this with a cronjob that ran rsync -av --delete /directory testing:/directory at a certain interval, say every hour. However, this would needlessly run sometime when there were no changes, and it if there were a lot of changes immediately after a run i tcould be nearly an hour until they were synced. A better solution might be to use lsyncd.

Lsyncd watches a local directory trees event monitor interface (inotify). It aggregates and combines events for a few seconds and then spawns one (or more) process(es) to synchronize the changes. By default this is rsync. Lsyncd is thus a light-weight live mirror solution that is comparatively easy to install not requiring new filesystems or blockdevices and does not hamper local filesystem performance.

You can mount the productive stuff to your testing system, so you’ll always have the current status. But keep in mind everything you change in your testing environment will affect the productive system too!

It depends on the type of systems you are using.

If you are running linux a simple Rsync can keep the production and testing in sync.
There are also Rsync utilities for Windows as well but I dont know who good they are.

Do you need replication both ways or just one way?

Leave a Reply

Your email address will not be published. Required fields are marked *