1

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.

Kyle Hudson
  • 202
  • 2
  • 11

2 Answers2

1

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

  • 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. –  Dec 26 '10 at 15:41
1

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.

devicenull
  • 5,622
  • 1
  • 26
  • 31
  • 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. –  Dec 23 '10 at 01: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 04:34