I have a load of apache servers all serving a variety of Rails applications. The codebase across all servers is the same, but the applications allow user uploads.
Question is, how do I best manage the filesystem here? I would like to only have to deploy code to one location, and would also like user uploads to be available to any node on the cluster.
Essentially, I guess I'm looking for a single filesystem that all the servers work off. Is this even performant? Is mirroring a better bet, or some sort of shared network filesystem?
What would you do?
The servers are all Ubuntu Linux.
If the performance of user uploads is critical, use mirroring. Otherwise, use nfs. I'm assuming you have some sort of caching implemented in Rails if you have a load of servers with lots of applications.
Anders
You could look at a clustered file system, e.g GFS or OCFS. Other wise NFS, maybe - though I suspect you may have problems with stale file handles, as we were trying to ue NFS for a similar thing for us. It depends how your app works.
We had three web servers and a staging box. The stagin box pushed out files to the web site content which was on NFS.
The my understanding of the problem (which is sketchy because I was not involved in the investigation or the fix) was the webservers would have a file open, say index.html and the staging server would push out a new copy of index.html. The new version would overwrte the old version, but when the webservers went to read it, they got stale file handle errors, because they still had references to the old version of the file, which had ben overwritten and replaced with a new file. So they were trying to reference a file that they had a file handle for, but that did not exist.