问题1:
设置primary node时提示不能成功UpToDate data:
1
2
3
|
# drbdadm primary r1
r1: State change failed: (-2) Need access to UpToDate data
Command 'drbdsetup primary r1' terminated with exit code 17
|
解决:
1
2
3
|
# drbdadm primary --force r1 ##强制设置
# drbd-overview
1:r1/0 Connected(1*) Primary(1*) UpToDate(1*)
|
问题2:
创建设备元数据时提示操作失败:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# 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
|
解决:
1
|
# dd if=/dev/zero of=/dev/sdb1 bs=1M count=100
|
问题3:
启用资源时提示失败,无法创建transport:
1
2
3
4
|
# 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模块
1
2
3
4
5
6
|
# 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:
启用资源时提示失败,配置要求无效:
1
2
3
4
5
|
# 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模块
1
2
3
4
5
6
7
|
# 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:
启动资源时提示失败,设备或资源忙
1
2
3
4
5
6
7
8
9
10
|
# 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
1
2
3
4
5
|
# drbdadm primary r1
r1: Failure: (158) Unknown resource
additional info from kernel:
unknown resource
Command 'drbdsetup primary r1' terminated with exit code 10
|
解决:
1
|
# /etc/init.d/drbd start
|
问题7及解决:
1
2
|
# drbd-overview
1:r1/1 Connec/Connec Second/Unknow UpToDa/DUnkno
|
1
|
# systemctl stop firewalld
|
1
2
|
# drbd-overview
1:r1/1 Connec/StaAlo Second/Unknow Outdat/DUnkno
|
1
|
# getenforce 0
|
问题8:
node2无法连接node1,显示node1为StandAlone
node1:
1
2
|
[root@node1 ~]# drbd-overview
1:mysqldata/1 Connec/Connec Second/Unknow UpToDa/DUnkno
|
node2:
1
2
|
[root@node2 ~]# drbd-overview
1:mysqldata/1 Connec/StaAlo Second/Unknow UpToDa/DUnkno
|
解决:
1
2
3
4
5
|
[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:
1
2
3
4
5
|
[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:
1
2
3
4
5
|
[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
|