1

Lets say I have a server that runs a program that runs some application. I saw there is a solution called pacemaker or high availibility.

Is there a way to make it so the second server has the same exact data and is synced with all the data on the first one so that if the first one goes out the second server has everything the first one had?

Is there a way to do it with just two servers and no other hardware?

1 Answer 1

1

Yes. We have something called DRBD; Distributed Replicated Block Device. It is sort of a RAID1 mirroring between two computers, so that whenever something is written to the disk of Server1, the same data is written to the disk of Server2, either synchronously or asynchronously. That's the data part.

For simple cases, this should suffice. It's not difficult to get it up and running. Give it a go in a couple of VMs until you're comfortable. Then you might want to read up on other things to handle service failover. You'll need some way to make the secondary act as primary if the primary fails. Or you can use a primary-primary solution, but that requires special filesystems and you'll want a direct connection between the servers.

This document from the official Ubuntu Server documentation should get you started on DRBD: https://help.ubuntu.com/12.04/serverguide/drbd.html. You'll find more details on the official site: http://www.drbd.org/

The guide in Ubuntu Server documentation will give you a synchronous solution.

2
  • Awesome. So my question is, i can drbd the entire system onto the second server and then load that system on the second server to act as the first one? In the event of something happening
    – sonicboom
    Mar 29, 2014 at 23:15
  • Not the system. The disk. The effect is the same, of course. Any byte that is written to the synced harddisk on server1 will also be written to the equivalent disk on server2. If server1 dies, then you'll make server2 primary and everything is fine. Using protocol C, you cannot access data on the secondary while the primary is running though. It gets more complicated if you need that. Mar 30, 2014 at 12:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .