DRBD Cluster

For complex topics that regular users would not be interested in. For power users and database administrators.
Post Reply
User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

DRBD Cluster

Post by Justin Shafer » Thu Jul 05, 2012 9:39 pm

Anyone interested in trying out DRBD with Mysql and Samba? Both computers running in VirtualBox on seperate computers???? DRBD and Heartbeat/Corosync

If so, let me know. I would like to give you guys something to play with for free. I am going to build it again, and then release it on a torrent or something?

teethdood
Posts: 267
Joined: Sun Jul 29, 2007 12:39 am
Location: Visalia, CA
Contact:

Re: DRBD Cluster

Post by teethdood » Thu Jul 05, 2012 9:50 pm

hi Justin,

Can you elaborate more on this setup? I have a couple of months left before the wife pops one out, would like something to play around with before diaper duties...
Philip H. Doan, DDS
http://www.kaweahdental.com/

User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: DRBD Cluster

Post by Justin Shafer » Fri Jul 06, 2012 6:24 am

Sure! Basically this cluster consists of different services all working together.

1. DRBD - The back bone. The best way to explain this is like this.. Do you know what a raid 1 array does??? It takes two partitions or hard drives and makes them the same all the time. They both receive the writes, so when the data is written, both drives are the same. So if a drive fails, you can keep working, on the most up to date data. This is what DRBD does, except the drives are on different computers. DRBD uses the network to write to both partitions on seperate computers. So if a computer dies, the other computer will still have a hard drive that had the most recent data. Or each computer can have a raid array, and then drbd can run on top of the arrays.

2. Heartbeat\Corosync. What this service does is control DRBD, and say MySQL, and Samba (Windows File-Sharing for linux, mac, unix) Heartbeat will run on both computers, and one computer will be assigned the task of being the "server".. which means one computer is running mysql and samba and all the computers are talking to it, over a fake ip address. If that computer dies, heartbeat that is running on the secondary computer will notice the computer died, then it can be configured to automatically resume primary. First it will take over the fake ip address, mount the partition, start mysql and samba. Open Dental clients do not miss a beat. They think the server never went down at all.

3. MySQL and Samba - MySQL is the database service, Samba is providing a file share for filesharing or mapped drives. MySQL clients do not miss a beat, but Samba clients seem to have to reconnect their mapped drives the last time I messed with this. I am hoping the failover on Samba has improved. But at least OpenDental itself doesn't lose access to MySQL.

Another Option is instead of using MySQL and Samba as the services, one can do VirtualBox or VMWare Workstation to where a virtual machine can be booted between the two computers. This Virtual Machine can be running Windows. Thing is, this cant be done virtually. In other words, you cant have a virtual machine, running another virtual machine. So Ubuntu would have to be installed Physically on 2 computers.

This is all just for fun and testing and amusement and educational purposes. I would not put it in an office until you at least have the commands written on a sheet of paper to deal with split-brains.
http://www.drbd.org/users-guide/s-split ... overy.html

It is rare, but can happen. If one server is written data too while the secondary server is for some reason shutdown.. And then lets say we shutdown the primary and boot up the secondary, and its configured to become primary if the other server is turned off. So it does, then a client also writes data to this computer. Now we have 2 servers, both with different data. DRBD can detect this, and there are ways of handling it.
In this situation, I think it would be best to handle it manually, since this is patient data, x-rays.. stuff like that. Automatic Overwrite just for the sake of syncing would be probably be frowned upon. :D That is where one server will just overwrite the other server so that way they are both up to date.

User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: DRBD Cluster

Post by Justin Shafer » Fri Jul 06, 2012 6:41 am


SpeedGP
Posts: 26
Joined: Wed Jun 15, 2011 7:37 am

Re: DRBD Cluster

Post by SpeedGP » Tue Jul 10, 2012 9:06 am

I've tried using DRDB a coupe times.... all with failure. I only have a limited (decent) understanding of linux, and I could never get the drives to sync.

If you've got this down, that is AWESOME! It sounds to be a very powerful application.


Any tips/tricks?

User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: DRBD Cluster

Post by Justin Shafer » Tue Aug 28, 2012 6:02 pm

Just a whole lot of reading.. I have been toying with linux for like 20 years so drbd was a little easier to get going.. Feel free to pm me if you have anything your stuck on...

User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: DRBD Cluster

Post by Justin Shafer » Tue Aug 28, 2012 6:02 pm

Just a whole lot of reading.. I have been toying with linux for like 15 years so drbd was a little easier to get going.. Feel free to pm me if you have anything your stuck on... 15 years went by to damn fast.

User avatar
drtech
Posts: 1647
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: DRBD Cluster

Post by drtech » Thu Aug 30, 2012 11:58 am

I would be interested in trying this out...I have lots of Linux experience, but no heartbeat or DRBD experience.
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

Post Reply