[support] Drupal files synchronization

Luke drupal at lists.tacticus.com
Wed Nov 4 21:08:44 UTC 2009


On Thu, 22 Oct 2009, Ivan Working wrote:

> My company is  using 3 Drupal servers with load balancer to distribute the load.
> The problem is the files in  sites/default/files folder need to be synchronized
> among these 3 Drupal servers.
> 
> I am thinking of using rsync for this purpose but I heard rsync may not be the
> best way to do it since it shouldn't delete the files so the number of 
> files will grow quickly.
> 
> Has anybody used rsync to synchronize the files?
> Is there a better method to synchronize files in sites/default/files?


I would be hesitant to use rsync to keep three sets of files universally 
synched like this, although I'm sure it could be done.

The best method is likely to involve a central file repository.

NFS share a file directory.  If you don't like NFS, then SSHFS mount the 
files directory from each of the machines.  If you're dealing with 
windows, there is (please don't anybody shoot me--this is not! how I would 
do it) smbmount.

SSHFS is the most easily deployed solution, but you will of course not 
want to be using password based auth, and for the sake of initial 
simplicity, you will want to use keys without passphrases.

If this is a really huge setup, you might consider one of the distributed 
filesystems, which store the files everywhere on the cluster, and export 
them to the files directories.  That is the most effective for load 
balancing purposes, but you'd have to really need it to take the trouble 
to implement it, and for anything smaller than thousands of files, I 
wouldn't even consider that option.

Luke


More information about the support mailing list