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 new to this concept. :)

Can I use a distributed filesystem in as a way to have redundancy for web applications?

Server A and Server B would have Apache/mySql installed on the distributed filesystem and server C manages the connections (if sA is down, go to sB - or a round-robin DNS). Would something like this work?

If so, that would be awesome, since I would not have to worry about db syncing and file syncing.

Thank you!

Edit: Thank you very much all for the informative answers! Lots of things for me to digest. I (almost) randomly nominated an answer.

share|improve this question
    
Can you? Yes. Should you? Hell no. –  womble Aug 11 '11 at 18:02

4 Answers 4

up vote 2 down vote accepted

Can I use a distributed filesystem in as a way to have redundancy for web applications?

Sure, you can.

Server A and Server B would have Apache/mySql installed on the distributed filesystem and server C manages the connections (if sA is down, go to sB - or a round-robin DNS). Would something like this work?

You can use MySQL replication or take a look at: http://dev.mysql.com/doc/refman/5.0/en/ha-overview.html

And Apache, you can setup A and B with DRBD in dual-primary mode and a cluster filesystem like GFS or OCFS2. About the C, you can use HAProxy or Pacemaker.

share|improve this answer

As for the MySQL bit, you can either setup a MultiMaster configuration ( http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-replication-multi-master.html ), or you can have a Master/Slave server, kept in sync via DRBD ( http://www.mysql.com/why-mysql/drbd/ ), with a heartbeat sensor to handle failover -- or you can just have a Master/Slave kept in sync via MySQL's internal replication; it's brain-dead simple to get up and running. There are about a million ways to handle failover between the two servers.

Other people have provided good answers to the Apache issue.

share|improve this answer

MySQL cannot run from a shared or synced filesystem. You will need to look into other solutions for that, for example using MySQL Cluster.

Apache and other web servers should be fine running on shared or synced storage. Make sure you share the session storage for your scripting language as well (e.g., PHP), otherwise the user will lose the session when changing server.

DNS round-robin is not a good solution for HA (high availability), and arguably not even for loadbalancing. Consider using some other technique. There are for example multiple solutions for loadbalancing which also achieves HA. From the top of my head: Linux Virtual Server (LVS), Varnish and possibly Nginx.

share|improve this answer
    
"MySQL cannot run from a shared or synced filesystem" -- I'd love to know where you got that idea. –  womble Aug 11 '11 at 17:59
    
womble, from this page: dev.mysql.com/doc/refman/4.1/en/multiple-servers.html I see now that they have removed the warning from newer versions of the manual, but that doesn't mean that the problems mentioned in the old manual shouldn't be considered. MySQL Cluster or similar solutions is still the preferred way. –  Emil Vikström Aug 12 '11 at 8:00
    
I see no mention of the word "synced" on that page, and the only mentions of "shared" are related to shared memory. The only restriction I can see is on having two MySQL servers using a common data directory, which isn't specific to a shared filesystem. –  womble Aug 12 '11 at 8:34

Since you aren't clear about what technology you're actually talking about, I assume by "distributed filesystem" you mean DFS.

DFS-R doesn't work with databases. You'll still need to provide redundancy at the database levels, however this will work for web content. You only need to update a single server and the changes will be replicated to the other servers in the DFS-R pool.

share|improve this answer

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.