DRBD编译安装中出现的问题及解决小结

转自http://wangzhijian.blog.51cto.com/6427016/1711284

问题1:

设置primary node时提示不能成功UpToDate data:

 # drbdadm primary r1      
r1: State change failed: (-2) Need access to UpToDate data
Command 'drbdsetup primary r1' terminated with exit code 17

解决:

# drbdadm primary --force r1          ##强制设置
# drbd-overview 
 1:r1/0  Connected(1*) Primary(1*) UpToDate(1*)

问题2:

创建设备元数据时提示操作失败:

# drbdadm -c /etc/drbd.conf create-md all
md_offset 314568704
al_offset 314535936
bm_offset 314523648

Found ext3 filesystem
      307200 kB data area apparently used
      307152 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 1 v09 /dev/sdb1 internal create-md 1' terminated with exit code 40

解决:

# dd if=/dev/zero of=/dev/sdb1 bs=1M count=100

问题3:

启用资源时提示失败,无法创建transport:

# drbdadm up r1
r1: Failure: (172) Failed to create transport (drbd_transport_xxx module missing?)
Command 'drbdsetup new-peer r1 1 --_name=node2 --shared-secret=123456 --cram-hmac-alg=sha1 --protocol=C' terminated with exit code 10
drbdadm: new-path r1: skipped due to earlier error

解决:

安装drbd_transport_tcp模块

# cp drbd_transport_tcp.ko /lib/modules/3.10.0-229.el7.x86_64/kernel/lib/
# depmod  
# modprobe drbd_transport_tcp
# lsmod|grep drbd_transport_tcp
drbd_transport_tcp     17731  0 
drbd                  463948  2 drbd_transport_tcp

问题4:

启用资源时提示失败,配置要求无效:

# drbdadm up r1
r1: Failure: (162) Invalid configuration request
additional info from kernel:
minor exists as different volume
Command 'drbdsetup new-minor r1 1 1' terminated with exit code 10

解决:

安装drbd模块

#  cd drbd-9.0.0/drbd
# cp drbd.ko /lib/modules/3.10.0-229.el7.x86_64/kernel/lib/
# depmod
# modprobe drbd
# lsmod |grep drbd
drbd                  463948  0 
libcrc32c              12644  2 xfs,drbd

问题5:

启动资源时提示失败,设备或资源忙

# drbdadm up r1
No valid meta data found
Command 'drbdmeta 1 v09 /dev/sdb1 internal apply-al' terminated with exit code 255
# drbdadm create-md all
open(/dev/sdb1) failed: Device or resource busy
Exclusive open failed. Do it anyways?
[need to type 'yes' to confirm] yes
# Output might be stale, since minor 1 is attached
Device '1' is configured!
Command 'drbdmeta 1 v09 /dev/sdb1 internal create-md 1' terminated with exit code 20

解决:

fdisk /dev/sdb 删除该分区保存,然后再重新新建分区并保存即可

问题6:

提示unknown resource

# drbdadm primary r1
r1: Failure: (158) Unknown resource
additional info from kernel:
unknown resource
Command 'drbdsetup primary r1' terminated with exit code 10

解决 :

# /etc/init.d/drbd start

问题7及解决:

# drbd-overview 
 1:r1/1  Connec/Connec Second/Unknow UpToDa/DUnkno
# systemctl stop firewalld
# drbd-overview 
 1:r1/1  Connec/StaAlo Second/Unknow Outdat/DUnkno
# getenforce 0

问题8:

node2无法连接node1,显示node1为StandAlone

node1:

[root@node1 ~]# drbd-overview 
 1:mysqldata/1  Connec/Connec Second/Unknow UpToDa/DUnkno
node2:

[root@node2 ~]# drbd-overview 
 1:mysqldata/1  Connec/StaAlo Second/Unknow UpToDa/DUnkno

解决:

[root@node2 ~]# drbdadm --discard-my-data connect all
[root@node2 ~]# drbd-overview 
 1:mysqldata/1  Connec/Connec Second/Unknow UpToDa/DUnkno 
[root@node2 ~]# drbd-overview                    ##从上一状态转为该状态需要些时间
 1:mysqldata/1  Connected(2*) Secondary(2*) UpToDa/UpToDa

问题9及解决:

node1和node2互相认为对方 StandAlone

node1:

[root@node1 ~]# drbd-overview 
 1:mysqldata/1  Connec/StaAlo Second/Unknow UpToDa/DUnkno 
[root@node1 ~]# drbdadm --discard-my-data connect all
[root@node1 ~]# drbd-overview 
 1:mysqldata/1  Connec/Connec Second/Unknow UpToDa/DUnkno
node2:

[root@node2 ~]# drbd-overview 
 1:mysqldata/1  Connec/StaAlo Second/Unknow UpToDa/DUnkno
[root@node2 ~]# drbdadm connect all
[root@node2 ~]# drbd-overview 
 1:mysqldata/1  Connected(2*) Secondary(2*) UpToDa/UpToDa
posted @ 2016-08-07 17:41  aallennty  阅读(257)  评论(0编辑  收藏  举报