我正在尝试在虚拟机上使用 centoOS 6.3 学习 drbd,我配置了两个虚拟机,节点 1 是原始的,节点 2 是从节点 1 克隆的,但我无法启动“service drbd start”,出现错误消息“启动 DRBD 资源:无法加载 drbd 模块”,而节点 2 可以启动该命令,这是配置
[root@localhost db]# cat /etc/drbd.conf
# You can find an example in /usr/share/doc/drbd.../drbd.conf.example
#include "drbd.d/global_common.conf";
#include "drbd.d/*.res";
global {
# do not participate in online usage survey
usage-count no;
}
resource data {
# write IO is reported as completed if it has reached both local
# and remote disk
protocol C;
net {
# set up peer authentication
cram-hmac-alg sha1;
shared-secret "s3cr3tp@ss";
# default value 32 - increase as required
max-buffers 512;
# highest number of data blocks between two write barriers
max-epoch-size 512;
# size of the TCP socket send buffer - can tweak or set to 0 to
# allow kernel to autotune
sndbuf-size 0;
}
startup {
# wait for connection timeout - boot process blocked
# until DRBD resources are connected
wfc-timeout 30;
# WFC timeout if peer was outdated
outdated-wfc-timeout 20;
# WFC timeout if this node was in a degraded cluster (i.e. only had one
# node left)
degr-wfc-timeout 30;
}
disk {
# the next two are for safety - detach on I/O error
# and set up fencing - resource-only will attempt to
# reach the other node and fence via the fence-peer
# handler
on-io-error detach;
fencing resource-only;
# no-disk-flushes; # if we had battery-backed RAID
# no-md-flushes; # if we had battery-backed RAID
# ramp up the resync rate
# resync-rate 10M;
}
handlers {
# specify the two fencing handlers
# see: http://www.drbd.org/users-guide-8.4/s-pacemaker-fencing.html
fence-peer "/usr/lib/drbd/crm-fence-peer.sh";
after-resync-target "/usr/lib/drbd/crm-unfence-peer.sh";
}
# first node
on node1.mycluster.org {
# DRBD device
device /dev/drbd0;
# backing store device
disk /dev/sdb;
# IP address of node, and port to listen on
address 192.168.1.101:7789;
# use internal meta data (don't create a filesystem before
# you create metadata!)
meta-disk internal;
}
# second node
on node2.mycluster.org {
# DRBD debice
device /dev/drbd0;
# backing store device
disk /dev/sdb;
# IP address of node, and port to listen on
address 192.168.1.102:7789;
# use internal meta data (don't create a filesystem before
# you create metadata!)
meta-disk internal;
}
}
有人知道这是什么问题吗?
答案1
这听起来不像是配置问题 - 而更像是没有安装 DRBD 的内核模块。您需要安装适当版本的 kmod-drbd。(如果您输入 modprobe drbd 会发生什么?)
从命令行尝试执行 yum search drbd
然后选择正确的包 - 可能是 kmod-drbd83
如果这不起作用,也许可以升级到较新版本的 CentOS 和内核。