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.
How to build a personnal cluster?
debian;cluster
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 postfix0If 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:Have some kind of shared storage, either SAN, drbd etc. or have support from the server systemAutomatically 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.