我正在使用 DRBD(配置如下)并尝试测试设置的可靠性。
我重新启动了辅助节点(host1
)并发现它进入了这种状态:
host1:
0:r0/0 WFConnection Secondary/Unknown UpToDate/DUnknown
host2:
0:r0/0 StandAlone Primary/Unknown UpToDate/DUnknown lvm-pv: vgr0 1861.65g 40.00g
drbd
服务在主服务器上运行,它也在辅助服务器上启动。但是,我在辅助服务器上尝试的任何操作都无法重新连接它:
drbdadm adjust all
drbdadm disconnect r0
drdbadm connect all
所有命令都以以下内容结尾:
Failure: (102) Local address (port) already in use.
最后,我在主服务器上重新启动了 drbd 服务 ( service drbd restart
)。仅此操作重新连接了服务:
host1:
0:r0/0 Connected Secondary/Primary UpToDate/UpToDate
host2:
0:r0/0 Connected Primary/Secondary UpToDate/UpToDate lvm-pv: vgr0 1861.65g 40.00g
这是为什么? 我可以在WFConnection
不重启主服务器服务的情况下恢复吗?
资源定义:
resource r0 {
protocol C;
startup {
wfc-timeout 15;
degr-wfc-timeout 60;
}
disk {
on-io-error detach;
c-fill-target 10M;
c-max-rate 700M;
c-plan-ahead 7;
c-min-rate 4M;
}
net {
# max-epoch-size 20000;
max-buffers 36k;
sndbuf-size 1024k;
rcvbuf-size 2048k;
after-sb-0pri discard-zero-changes;
after-sb-1pri discard-secondary;
after-sb-2pri disconnect;
rr-conflict disconnect;
}
syncer {
rate 400M;
al-extents 6433;
}
on host1 {
device /dev/drbd0;
disk /dev/sdc;
address 10.0.0.2:7788;
meta-disk internal;
}
on host2 {
device /dev/drbd0;
disk /dev/sdc;
address 10.0.0.3:7788;
meta-disk internal;
}
}
我将/dev/drbd0
其用作 LVM 卷:
% pvdisplay /dev/drbd0
--- Physical volume ---
PV Name /dev/drbd0
VG Name vgr0
PV Size 1.82 TiB / not usable 3.79 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 476583
Free PE 466343
Allocated PE 10240
PV UUID JC0Us5-jxC1-9u2F-Wsyp-toJy-E2J4-sXu8Id