How do you configure mixed replication modes in DRBD 9 [closed]

Device stacking was deprecated in DRBD9, and I am unsure how to define different replication protocols between multiple peers in a DRBD 9 configuration.

Specifically, I'm trying to configure two nodes to use Protocol C for High Availability and a third node to use Protocol A for Disaster Recovery.


You're correct, DRBD 9.x has deprecated stacking since you're able to have up to 32 replcas/peers per DRBD resource with DRBD 9. Stacking was used in DRBD 8.x because there was a 2 node limit per resource.

You can specify options on specific connections between peers in DRBD 9.x configurations. In the case of three nodes, you can use protocol c for synchronous replication between node-a and node-b, then use protocol a for asynchronous replication between node-a/b and node-c.

Here's an example DRBD 9.x configuration where node-c is the asynchronous peer:

resource r0 {
  device    /dev/drbd0;
  disk      /dev/sdb;
  meta-disk internal;
 
  on node-a {
    node-id   0;
  }
 
  on node-b {
    node-id   1;
  }
 
  on node-c {
    node-id   2;
  }

  connection {
    host node-a address 192.168.222.20:7777;
    host node-c address 192.168.222.22:7777;
    net {
      protocol A;
    }
  }

  connection {
    host node-b address 192.168.222.21:7777;
    host node-c address 192.168.222.22:7777;
    net {
      protocol A;
    }
  }

  connection {
    host node-a address 192.168.222.20:7777;
    host node-b address 192.168.222.21:7777;
    net {
      protocol C;
    }
  }
}