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 am wanting to implement a multi-server specialised hosting environment.

I currently have a cloud solution comprising of 3 centos boxes (2 lamp web servers, 1 mysql).

What I am wanting to do is, implement a 5 server solution where they is 3 web servers, 1 mysql box and a fileshare.

Basically I want the fileshare to host all the web files for the servers, the caching will remain on the individual servers and the sessions will be stored in mysql. So what I am asking is how do I map the servers to share the same "docroot"? Is it NFS? if so whats the best way about doing this?

Thanks in advance.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Yes, use NFS server on the box you label as "fileshare" and the webheads are NFS clients. Google "nfs howto centos" and you'll get a million tutorials.

http://www.howtoforge.com/setting-up-an-nfs-server-and-client-on-centos-5.5

share|improve this answer
    
Thank you Troy. –  Kyle Hudson Dec 26 '10 at 14:30
    
you're welcome! btw, I just read about your sessions; consider using memcached running on your fileshare or mysql box instead, and use php-memcache module to store the sessions. It's a lot faster, writing sessions to MySQL can introduce a lot of performance hits for the other databases/tables with your real data. –  troyengel Dec 26 '10 at 15:41

Have you taken a look at http://www.drbd.org/ ? This might do what you want. I'd also suggest ignoring the filesystem entirely, and using something like Memcached to store you data. This would give you the advantage of being able to scale your web servers up and down with no configuration/data sync issues.

You could also setup an rsync job on a somewhat fast cron (do you need the pages to be fully live, or is a 1 minute delay good enough)? Just sync the files from the fileserver every minute.

I'd suggest avoiding NFS, it's not exactly high performance.

share|improve this answer
1  
so many bad ideas in one comment I don't even want to get into it. NFS is plenty high performance depending on how you use it, the guy didn't say he needs to run Google Images on the thing, just share content between two nodes. –  troyengel Dec 23 '10 at 1:06
    
A one minute delay would be fine, decided to just use NFS for now. –  Kyle Hudson Dec 26 '10 at 14:31
    
Other reasons to avoid NFS: 1) lack of security (if you're using the typical NFSv3), which may be a bigger concern since you're "in the cloud" rather than your own datacenter; 2) craziness with locking; 3) limitations on the number of supplemental groups a process can belong to. –  mattdm Jan 17 '11 at 4:34

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.