[DRBD-user] drbd on localhost

Valentin Vidic Valentin.Vidic at CARNet.hr
Tue Apr 13 13:44:26 CEST 2010

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


On Mon, Apr 12, 2010 at 01:57:24PM +0400, Anatoly wrote:
> How can I setup drbd between two local dosks on one node?
> I understand this is stupid idea. But can I do this? If yes, how?

I'm not sure why you want this but the following configuration
might be useful for testing:

resource drbd0 {
  protocol C;

  on node1 {
    device /dev/drbd0;
    disk /dev/vg0/disk0;
    address 127.0.0.1:7790;
    meta-disk "internal";
  }

  on node2 {
    device /dev/drbd1;
    disk /dev/vg0/disk1;
    address 127.0.0.2:7791;
    meta-disk "internal";
  }
}

resource drbd1 {
  protocol C;

  on node1 {
    device /dev/drbd1;
    disk /dev/vg0/disk1;
    address 127.0.0.1:7791;
    meta-disk "internal";
  }

  on node2 {
    device /dev/drbd0;
    disk /dev/vg0/disk0;
    address 127.0.0.2:7790;
    meta-disk "internal";
  }
}

Since drbd does not allow repeated addresses additional firewall rules are
required:

iptables -t nat -A OUTPUT -d 127.0.0.2 -p tcp --dport 7790 -j DNAT --to-destination 127.0.0.1
iptables -t nat -A OUTPUT -d 127.0.0.2 -p tcp --dport 7791 -j DNAT --to-destination 127.0.0.1

-- 
Valentin



More information about the drbd-user mailing list