Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

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.

share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.