I have a debian server running some services (mail, web, git, mysql...). But it is alone, meaning that if it breaks, I have to repair it to access my services.

I'd like to put a second server so that if the first one dies the second one is automatically ready to work. I don't want any of this servers to be a master and the other one a slave. The idea is to prevent hardware failure from any of the two servers.

I found lots of info about how to create some big clusters, but I haven't found any thing that imply only two servers.

  • This is a cool question, but you might get a better answer from the Server Fault SE site.
    – n0pe
    Mar 1, 2013 at 3:56
  • @MaxMackie The "personal" part would seem to render this question off topic on SF.
    – user
    Mar 1, 2013 at 9:39
  • 1
    for configurations i recommend you use puppet
    – ixtmixilix
    Mar 1, 2013 at 10:25

2 Answers 2


Creating an ha environment has a lot of caveats and is complicated, and often times depends on the actual software (e.g. creating a master-slave environment for mysql is different than for postfix0

If you want to get started and only want to have two systems and don't have time to configure all your daemons accordingly you should have a look at drbd, raid-1 over the network. With that all the content of the blockdevice will get replicated to your other system. Combine that with something like corosync or heartbeat and you can have the other system automatically take over.

In general it boils down to:

  1. Have some kind of shared storage, either SAN, drbd etc. or have support from the server system
  2. Automatically detect an outage of an system and take over responsibility (e.g. IP or remove it from the cluster)

If you don't have a shared storage system you typically have to have support in your application, such systems are for example cassandra, mongodb etc.

  • 1
    There's a good set of docs on linuxvirtualserver.org about how to provide a HA front end for whatever your replicated service may be.
    – Matt
    Mar 1, 2013 at 9:34
  • 1
    @mindthemonkey the examples seems to be all http/application specific. but yeah the underlying principle, shared storage, monitoring system etc. there is also linux-ha.org which provides an introduction into the different software components. Mar 1, 2013 at 9:40

Heartbeat is deprecated .

Use Pacemaker + Corosync for 1+1 , N+1, N+N clusters

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.