heartbeat+drbd实现双机备份,drbd启动报错

drbd启动报错:
主机:
[root@bjfu1 drbd.d]# service drbd start
Starting DRBD resources: [
create res: r1
prepare disk: r1
adjust disk: r1:failed(apply-al:255)
adjust net: r1
]
..........


DRBD's startup script waits for the peer node(s) to appear.

  • In case this node was already a degraded cluster before the reboot the timeout is 0 seconds. [degr-wfc-timeout]
  • If the peer was available before the reboot the timeout will expire after 0 seconds. wfc-timeout To abort waiting enter 'yes' [1944]: yes

.
备机:
[root@bjfu2 drbd.d]# service drbd start
Starting DRBD resources: [
adjust disk: r1:failed(attach:10)
]
..........


DRBD's startup script waits for the peer node(s) to appear.

  • In case this node was already a degraded cluster before the reboot the timeout is 0 seconds. [degr-wfc-timeout]
  • If the peer was available before the reboot the timeout will expire after 0 seconds. wfc-timeout To abort waiting enter 'yes' [ 17]:

我的配置文件drbd.res:
resource r1 { #这个r1是定义资源的名字
on bjfu1 { #on开头,后面是主机名称
device /dev/drbd0; #drbd设备名称
disk /dev/sdb1; #drbd0使用的磁盘分区为sdb1
address 10.0.0.1:7789; #设置drbd监听地址与端口
meta-disk internal;
}
on bjfu2 { #on开头,后面是主机名称
device /dev/drbd0; #drbd设备名称
disk /dev/sdb1; #drbd0使用的磁盘分区为sdb1
address 10.0.0.2:7789; #设置drbd监听地址与端口
meta-disk internal;
}
}

我的配置文件global_common.conf:
global {
usage-count yes;
}

common {
handlers {
pri-on-incon-degr "/usr/lib/drbd/notify-pri-on-incon-degr.sh; /usr/lib/drbd/notify-emergency-reboot.sh; echo b > /proc/sysrq-trigger ; reboot -f";
pri-lost-after-sb "/usr/lib/drbd/notify-pri-lost-after-sb.sh; /usr/lib/drbd/notify-emergency-reboot.sh; echo b > /proc/sysrq-trigger ; reboot -f";
local-io-error "/usr/lib/drbd/notify-io-error.sh; /usr/lib/drbd/notify-emergency-shutdown.sh; echo o > /proc/sysrq-trigger ; halt -f";
}

startup {

}

options {

}

disk {
    on-io-error detach; #配置I/O错误处理策略为分离 
}

net {

}

syncer {
    rate 1024M; #设置主备节点同步时的网络速率
} 

}

这是错误原因“adjust disk: r1:failed(attach:10)“
添加新硬盘不要格,使用drbdadm create-md r1发现 另外disk /dev/sdb1改为disk /dev/sdb方可正常启动

求各位大神帮忙啊~~~

我也遇到同样的问题找了好久:
试试这个 原因是分完区后没有激活
1初始化磁盘文件格式, dd if=/dev/zero bs=1M count=1 of=/dev/sd1; sync
自己算大小....希望能帮到你

再试试这个
mknod /dev/drbd0 b 147 0