drbd-user March 2010 archive
Main Archive Page > Month Archives  > drbd-user archives
drbd-user: [DRBD-user] automaticly split brain recovery.. my sce

[DRBD-user] automaticly split brain recovery.. my scenario

From: Peter den Hartog <peterdenhartog_at_nospam>
Date: Wed Mar 24 2010 - 11:20:23 GMT
To: drbd-user@lists.linbit.com

Hello and thank you for reading this..

I have the following situation:
I have xen cloud running on 8 servers, and nfs+drbd+heartbeat on 2
fileservers.

The VM's get streamed from the NFS share, to the xen cloud. So far so good,
this works great.

When server-1 fails, the virtual machines of the xen cloud keep on working
perfectly, because well.. there is 1 primary server-2, with the correct
data.
But! when i reconnect the other server, you get a split-brain, Now what i
would like to do is, that server-2 stays the primary, server-1 get's synced
again and stays secundary.
But what i see now, is that when i don't change files on the server,
server-1 becomes primary and 2 becomes primary. The nfs share is offline for
to long, and my VM's crash.
But when the data does change, while server-1 is down, server-2 stays
primary, and server-1 reboots and become secundary.. This is what i want,
but then for every network crash.

So what i basicly want is this: the server with the most up to data, stays
primary, and the other one becomes secundary.

Anybody can help me with the config file i'm using?

Thanks,
Peter

*I'm fully aware that this is bad to use, but it's a situation where people
are unable to reach the servers when something goes wrong, so i need
auto-recovery from split brain.*

the config file:
nfs-1:~# cat /etc/drbd.conf
global {
usage-count yes;
}
common {
  syncer { rate 10M; }
}

resource r0 {
  protocol C;
  handlers {
    }
  startup {
    degr-wfc-timeout 10; # 2 minutes.
    become-primary-on nfs-1;
  }
  disk {
    on-io-error detach;
  }

  net {
    after-sb-0pri discard-least-changes;
    after-sb-1pri discard-secondary;
    after-sb-2pri violently-as0p;
    rr-conflict violently;
 }

  syncer {
    rate 100M;
    al-extents 257;
  }

on nfs-1 {
    device /dev/drbd0;
    disk /dev/sdb1;
    address 10.100.255.9:7788;
    meta-disk internal;
  }

on nfs-2 {
    device /dev/drbd0;
    disk /dev/sdb1;
    address 10.100.255.10:7788;
    meta-disk internal;
  }
}
nfs-1:~#

_______________________________________________
drbd-user mailing list
drbd-user@lists.linbit.com
http://lists.linbit.com/mailman/listinfo/drbd-user