环境 centos 6.5

          2.6.32-431.el6.x86_64

1 安装一个yum的源

rpm -Uvh http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm
2  直接yum安装DRBD
 yum -y install drbd83-utils kmod-drbd83
我测试过,安装 drbd84-utils kmod-drbd84  也可以,目前我只是刚安装好,还没测试可用性

参考链接   https://www.unixmen.com/configure-drbd-centos-6-5/


今天又测试了一下安装后的可用性,发现安装好后发现不了drbd的核心模块

报错    

[root@HA2 drbd.d]# /sbin/modprobe drbd

FATAL: Module drbd not found.

网上查了一下,说是因为安装drbd核心模块的时候升级了内核,需要重启才可以。于是查了一下安装后的核心版本

[root@HA2 ~]# uname -r

2.6.32-642.6.2.el6.x86_64

果然核心和之前的环境不一致了。于是老老实实重启,然后执行/sbin/modprobe drbd,可以正常执行了

之后再执行   

drbdadm create-md web   报错

--==  Thank you for participating in the global usage survey  ==--

The server's response is:


you are the 16696th user to install this version

md_offset 5362810880

al_offset 5362778112

bm_offset 5362614272


Found ext3 filesystem

     5237124 kB data area apparently used

     5236928 kB left usable by current configuration


Device size would be truncated, which

would corrupt data and result in

'access beyond end of device' errors.

You need to either

   * use external meta data (recommended)

   * shrink that filesystem first

   * zero out the device (destroy the filesystem)

Operation refused.


Command 'drbdmeta 0 v08 /dev/sdb5 internal create-md' terminated with exit code 40


检查自己的配置文件,和网上案例唯一的区别是我在制定disk的时候制定的是分区,不是整块硬盘,于是删除分区号,再次执行,问题解决。不知道为什么不能指定分区,而是必须指定磁盘。