Portal Home > Knowledgebase > Articles Database > Load balancing and syncing two directories in real time


Load balancing and syncing two directories in real time




Posted by UberTricep, 10-31-2012, 03:27 PM
Hello, I am looking to spread my website across two load balanced servers. Both running the exact same software. This way, if there is any problem with one server, the second is always there to immediately take over. But the problem is my website will have files that are updated or deleting very regularly and therefore I will need to sync a single directory in real time. For example, using FTP I upload a file on server A. A request for that file is made 1 second later on server B and so a 404 error will happen. Rsync would not be a good idea because I need this solution to be scalable, hosting 500GB data and using rsync would take an extremely long time. If there is a solution to this then please let me know. Many thanks!

Posted by zoid, 10-31-2012, 03:30 PM
Are these servers physically located close to each other? If yes you could choose a NAS solution and basically outsource the storage from the servers.

Posted by lockbull, 11-01-2012, 02:18 AM
As zoid mentioned, shared storage is one option. Another one to consider if you're running Linux is DRBD, an open source solution. If you want more advanced features (such as 3 node replication) and support, the developer of DRBD, Linbit, has commercial offerings. There are also a plethora of clustered or distributed file system solutions offering various degrees of polish and sophistication, such as Lustre, Gluster, OCFS, etc. Going into differences among these is a rather lengthy subject, but suffice it to say, DRDB is probably the easiest free solution available.

Posted by josephgarbett, 11-03-2012, 07:01 AM
Perhaps change your approach to this. You could utilise Amazon's Web Service CDN. That way, all files are centralised and the only thing your servers are going to do is serve files linking to AWS. You can PUSH and DELETE from AWS via shell which I believe is what you want to be able to do. Last edited by josephgarbett; 11-03-2012 at 07:05 AM.

Posted by syleishere, 11-17-2012, 01:06 PM
SOunds like you need iscsi, I wrote a good howto on the subject here: http://blog.*********.com/linux/iscs...h-freebsd-zfs/ Why not just have both servers mount the same drives as if they were local.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Minecraft security (Views: 591)