sync of static resources in shared-nothing architecture

If we have the setup 1 balances N web-servers 1 database server, and users my upload resources like an image, how do you sync the public directories?

-- fxn

rsync -cure ssh /source/path/ destination_server.com:/destination/path/

Assuming you can log in to the other box via SSH keys, this rsync command can be put in a cron job or triggered by a directory watcher to keep one or more other hosts in sync with the master upload directory.

If we have the setup 1 balances N web-servers 1 database server, and users my upload resources like an image, how do you sync the public directories?

While our users don't upload content, our content folks do. Our setup looks like this:

N web servers 1 content admin server (same as web, just dedicated to our staff) 1 master media server 4 media slaves

When staff upload an image/video/pdf/flash/etc via the content admin server it then re-posts it to the master media server which stores on disk, then "tickles" (via curl) each of the slaves to request that url. The slaves are configured with an error handler such that if they don't have the the resource they fetch it from the master and then redirect to itself.

This way 99% of the time images are immediately spread to all the slaves, but on the off chance they aren't, the slaves can still fetch it when someone requests it.

We've found that curl is fast enough that the fetch-then-redirect-to-m yself isn't noticable...

-philip