[Drbd-dev] drbd local replication usage problem

莊凱傑 kcchuang.white at gmail.com
Mon Jun 10 14:20:22 CEST 2019


Hi drbd-dev,

It will be appreciated if you can give me some advice.
I'm try to do local block device replication(vda vdb), in the very
beginning I use drbdsetup to create a local replication connection with the
same ip + different port, and it works(as attached
drbdsetup-to-create-local-replication.sh). It seems like drbd kernel module
support this kind of usage(local replication).

Then I try to make it as /etc/drbd.d/*.res formats, I create r0.res and
r0-local.res. When I execute drbdadm up r0, drbdadm report error(as
attached drbdadm_up_error.log) something like "address conflict". And I
found it was caused by the function 'check_addr_conflict' in
$drbd-utils/user/v9/drbdadm_postparse.c Line 1171~1173, I can see the
comments of check_addr_conflict(below), but I don't get it ^^" :
/* An AF/IP/addr triple might be used by multiple connections within one
resource,  but may not be mentioned in any other resource... */. As my
understanding the function check_addr_conflict is checking all resources if
there's any AF/IP/addr triple mentioned in any other resources.

*My questions are:*
*Q1. why an AF/IP/addr triple may not be mentioned in any other resource?*
*Q2. I mark off Line 1171~1173, make drbdadm skip 'check_addr_conflict' and
it works. Do you have any concerns? *
*Do you have any idea to do local replication with drbdadm and configured
/etc/drbd.d/*.res ?*

== attached files contents ==
1. drbdsetup-to-create-local-replication.sh:
# create r0 resource
drbdmeta 1 v09 /dev/vda internal create-md 3 --force
drbdsetup new-resource r0 1
drbdsetup new-minor r0 1 0
drbdsetup attach 1 /dev/vda /dev/vda internal
drbdsetup new-peer r0 2 --_name=local --protocol=C
drbdsetup primary r0 --force
drbdsetup  connect r0 2

# create r0-local resource
drbdmeta 2 v09 /dev/vdb internal create-md 3 --force
drbdsetup new-resource r0-local 2
drbdsetup new-minor r0-local 2 0
drbdsetup attach 2 /dev/vdb /dev/vdb internal
drbdsetup new-peer r0-local 0 --_name=local --protocol=C
drbdsetup connect r0-local 1

# start syncing vda to vdb ...

2. drbdadm_up_error.log:
[root at k80 ~]# /usr/sbin/drbdadm.org up r0
/etc/drbd.d/r0.res:0: in resource r0
    ipv4:192.168.122.80:7789 is also used /etc/drbd.d/r0-hot.res:0
(resource r0-local)
/etc/drbd.d/r0.res:0: in resource r0
    ipv4:192.168.122.80:7790 is also used /etc/drbd.d/r0-hot.res:0
(resource r0-local)

3. /etc/drbd.d/r0.res(as attached):
resource r0 {
  device /dev/drbd1;
  meta-disk internal;
  disk "/dev/vda";
  on k80 {
    node-id 1;
    address 192.168.122.80:7789;
  }
  on local {
    node-id 2;
    address 192.168.122.80:7790;
  }

  connection-mesh {
    hosts k80 local;
  }
}

4. /etc/drbd.d/r0-local.res:
resource r0-local {
  disk "/dev/vdb";
  device /dev/drbd2;
  meta-disk internal;
  on k80 {
    node-id 2;
    address 192.168.122.80:7790;
  }
  on local {
    node-id 1;
    address 192.168.122.80:7789;
  }

  connection-mesh {
    hosts  k80 local;
  }
}


-- 
Thanks,
Kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linbit.com/pipermail/drbd-dev/attachments/20190610/bf10b579/attachment.htm>
-------------- next part --------------
resource r0-local {
  disk "/dev/vdb";
  device /dev/drbd2;
  meta-disk internal;
  on k80 {
    node-id 2;
    address 192.168.122.80:7790;
  }
  on local {
    node-id 1;
    address 192.168.122.80:7789;
  }

  connection-mesh {
    hosts  k80 local;
  }
}
-------------- next part --------------
resource r0 {
  device /dev/drbd1;
  meta-disk internal;
  disk "/dev/vda";
  on k80 {
    node-id 1;
    address 192.168.122.80:7789;
  }
  on local {
    node-id 2;
    address 192.168.122.80:7790;
  }

  connection-mesh {
    hosts k80 local;
  }
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: drbdsetup-to-create-local-replication.sh
Type: text/x-sh
Size: 595 bytes
Desc: not available
URL: <http://lists.linbit.com/pipermail/drbd-dev/attachments/20190610/bf10b579/attachment.sh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: drbdadm_up_error.log
Type: application/octet-stream
Size: 293 bytes
Desc: not available
URL: <http://lists.linbit.com/pipermail/drbd-dev/attachments/20190610/bf10b579/attachment.obj>


More information about the drbd-dev mailing list