Xavier Noria
2006-Nov-16 10:36 UTC
[OT] 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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Benjamin Curtis
2006-Nov-16 13:52 UTC
Re: [OT] sync of static resources in shared-nothing architecture
From my recent blog post on the topic, http://www.bencurtis.com/ archives/2006/11/how-to-handle-uploaded-files-with-rails/, use rsync: 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. -- Building an e-commerce site with Rails? http://www.agilewebdevelopment.com/rails-ecommerce On Nov 16, 2006, at 2:36 AM, Xavier Noria wrote:> > 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 >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Danny Burkes
2006-Nov-16 15:02 UTC
Re: [OT] sync of static resources in shared-nothing architec
You might also consider putting the shared static resources on an central file store, and mounting that volume by NFS on all your web servers. With Lingr (http://www.lingr.com), for example, images that users upload go onto an NFS-mounted volume that physically lives on the database server. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Philip Hallstrom
2006-Nov-16 16:12 UTC
Re: [OT] 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?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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---