Unix & Linux Asked by Tanatos Daniel on December 14, 2020
I use wmware workstation to run two virtual machines with OpenVZ 2.6.32-042stab108.2
installed on top on CentOS 6.6
. I have created another primary partition, /dev/sda4
, to configure it as drbd resource. I also created a filsystem on it. The second machine is actually created using the virtual disk of the first one, with changed hostname and eth0 ip address. The drbd configuration file is this:
global { usage-count no; }
common { syncer { rate 100M; } }
resource r0 {
protocol C;
startup {
wfc-timeout 15;
degr-wfc-timeout 60;
}
net {
cram-hmac-alg sha1;
shared-secret "password";
}
on primary {
device /dev/drbd0;
disk /dev/sda4;
address 192.168.18.10:7788;
meta-disk internal;
}
on secondary {
device /dev/drbd0;
disk /dev/sda4;
address 192.168.18.20:7788;
meta-disk internal;
}
}
After creating the resource with drbdadm create-md r0, when I enter service drbd start, I get:
Failure: (127) Device minor not allocated.
The output of drbdadm dump all might be helpful:
[root@primary ~]# drbdadm dump all
# /etc/drbd.conf
# resource r0 on primary: not ignored, not stacked
resource r0 {
protocol C;
on primary {
device /dev/drbd0 minor 0;
disk /dev/sda4;
address ipv4 192.168.18.10:7788;
meta-disk internal;
}
on secondary {
device /dev/drbd0 minor 0;
disk /dev/sda4;
address ipv4 192.168.18.20:7788;
meta-disk internal;
}
net {
cram-hmac-alg sha1;
shared-secret danuts;
}
startup {
wfc-timeout 15;
degr-wfc-timeout 60;
}
}
What is causing this error and how can it be mitigated? Thanks!
I just had the same error , it appeared that IP address for the second node was not reachable. First i checked the service status:
systemctl status drbd.service
â drbd.service - DRBD -- please disable. Unless you are NOT using a cluster manager.
Loaded: loaded (/usr/lib/systemd/system/drbd.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since mar. 2018-04-10 16:21:49 CEST; 5s ago
Process: 3347 ExecStart=/lib/drbd/drbd start (code=exited, status=20)
Main PID: 3347 (code=exited, status=20)
avril 10 16:21:49 GROESSLTCL0B systemd[1]: Starting DRBD -- please disable. Unless you are NOT using a cluster manager....
avril 10 16:21:49 GROESSLTCL0B drbd[3347]: Starting DRBD resources: drbd.d/r0.res:20: in resource r0, on GROESSLTCL0B:
avril 10 16:21:49 GROESSLTCL0B drbd[3347]: IP 192.168.254.2 not found on this host.
avril 10 16:21:49 GROESSLTCL0B systemd[1]: drbd.service: main process exited, code=exited, status=20/n/a
avril 10 16:21:49 GROESSLTCL0B systemd[1]: Failed to start DRBD -- please disable. Unless you are NOT using a cluster manager..
avril 10 16:21:49 GROESSLTCL0B systemd[1]: Unit drbd.service entered failed state.
avril 10 16:21:49 GROESSLTCL0B systemd[1]: drbd.service failed.
So i fixed the IP of the second node in r0.res , the new content is as following:
resource r0 {
protocol "C";
net {
allow-two-primaries;
after-sb-0pri discard-zero-changes;
after-sb-1pri discard-secondary;
after-sb-2pri disconnect;
}
on GROESSLTCL0A {
device /dev/drbd0;
disk /dev/sdb;
address 163.104.8.108:7789;
meta-disk internal;
}
on GROESSLTCL0B {
device /dev/drbd0;
disk /dev/sdb;
address 163.104.8.107:7789;
meta-disk internal;
}
}
Then i recreated the resource:
drbdadm create-md r0
after that i restarted drbd service and all was working as expected.
Answered by Soufas on December 14, 2020
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP