I am a web developer at my company and am therefore qualified to be an IT guy, apparently. I have a single Ubuntu web and file server currently, but I want to break up the server tasks onto two different systems, both of which I want to be highly available. We have no backup system in place, so if this box goes down, we are done.

All of my computers that use the file server are Macs, so I was considering getting two Mac Pros to use for IP failover. I already have two PCs I can use to throw a distro of Linux on for the web server. I want the data of both Linux boxes to mirror each other and both Mac Pros to mirror each other, though I haven't found a solution for that yet.

Am I approaching this right? Is my thinking in line with industry standards? I realize there are probably numerous ways of attacking this. I am trying to prepare for growth, while fixing the backup issue.

  • You can use rsync to synchronise the files between the two servers and something like haproxy to ensure high-availability. – sybreon Sep 7 '11 at 15:52
  • @sybreon - rsync sounds like it requires manual or cron'd initializing, which won't work (unless it gets cron'd every second, though that doesn't sound efficient at all). Is there a type of hardware that does mirroring? haproxy sounds like it might work well with heartbeat on the linux boxes. not sure if theres an equivalent for the mac servers. – cfree Sep 7 '11 at 16:11
  • Is there a reason why you'd have to have Mac Pros to serve the files? If you're already doing it with an Ubuntu machine, I'd either stick with a few more Linux boxes to build an HA file server cluster (in addition to the Apache cluster) or put both functions on (one) HA cluster. – Kendall Sep 7 '11 at 17:41
  • @Kendall - The Macs are having issues with file permissions on the Ubuntu server. It makes sense to have the Macs talk to a Mac server to keep the peace. We also want the device file-sharing capabilities, software update distribution, user management, wiki, etc. Also, the boss will need to get in there, so, GUI. We wanted to keep them separate because its a development web server, so we want minimal potential file server interruption. We have two poweredge servers sitting around, so why not? – cfree Sep 7 '11 at 21:20

For the Highly Available web servers, look into OpenAIS, Pacemaker and DRBD to build an HA Cluster. OpenAIS is cluster messaging software, Pacemaker is Cluster Resource Management software, and DRBD (Distributed Replicated Block Device) is "network RAID1". Combining these, you can build a cluster out of two or more nodes.

There are basically two ways to do it: active/passive, and active/active. Active/passive is going to be the easiest to setup (and maintain). In active/passive, one machine provides services, while the other sits idle and waits for the active machine to fail. In active/active, both machines would provide services.

OpenAIS will handle passing messages between cluster nodes to make sure they are available and responding.

Pacemaker will handle running your resource, eg Apache, DRBD, FTP, whatever. It also handles moving resources between nodes (say, in the event of a node failure) and handles stop/start/management of resources.

DRBD, is pretty cool. It sits between the kernel and the filesystem and (in Protocol C) when a write is issued, DRBD issues a write to the other cluster node, and once both nodes confirm the write to disk, it is considered committed. So basically the write has to be on-disk on both nodes to be committed. This is how you make sure that whatever you are serving up with Apache, is exactly the same on both machines, so should a failover occur you're serving up the same thing.

If you had shared storage (eg, an iSCSI SAN), then you could remove DRBD from the mix.

You can google Clusters From Scratch (it's on ClusterLabs.org) for a basically step-by-step guide to doing this.

  • Excellent answer, thank you! Two questions: 1 - Is there an advantage or disadvantage to using these services over specialty hardware, like the Barracuda Load Balancer? 2 - Is it redundant to have Highly Available servers like these, in addition to a SAN backup of the servers? – cfree Sep 7 '11 at 21:20
  • Normally you only create clusters for master-/write- services and let load balancing do reads, possibly with sticky connections. Your answer is good, but cfree might consider having a load balancer like HAProxy in front of two boxes running the web instead; one of the wwws go down, and HAProxy will notice this. Other than that, +1 for the answer. – Henrik Jul 26 '12 at 19:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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