Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
    
This is a cool question, but you might get a better answer from the Server Fault SE site. –  MaxMackie Mar 1 '13 at 3:56
    
@MaxMackie The "personal" part would seem to render this question off topic on SF. –  Michael Kjörling Mar 1 '13 at 9:39
1  
for configurations i recommend you use puppet –  ixtmixilix Mar 1 '13 at 10:25
add comment

2 Answers 2

up vote 7 down vote accepted

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.

share|improve this answer
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. –  mtm Mar 1 '13 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. –  Ulrich Dangel Mar 1 '13 at 9:40
add comment

Heartbeat is deprecated .

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

share|improve this answer
add comment

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.