我目前正在尝试通过XEN模拟环境.我安装了两个具有这种FS布局的debian系统:
cltest1:/etc# df -h Filesystem Size Used Avail Use% Mounted on /dev/xvda2 6.0G 417M 5.2G 8% / tmpfs 257M 0 257M 0% /lib/init/rw udev 10M 16K 10M 1% /dev tmpfs 257M 4.0K 257M 1% /dev/shm
主机cltest2是相同的.
这是我的drbd.conf
global { minor-count 1; } resource MysqL { protocol C; syncer { rate 10M; # 10 Megabytes } on cltest1 { device /dev/drbd0; disk /dev/xvda2; address 192.168.1.186:7789; Meta-disk internal; } on cltest2 { device /dev/drbd0; disk /dev/xvda2; address 192.168.1.187:7789; Meta-disk internal; } }
我没有在drbd0上创建文件系统
通过init.d脚本错误启动DRBD:
Starting DRBD resources: [ d(MysqL) /dev/drbd0: Failure: (114) Lower device is already claimed. This usually means it is mounted. [MysqL] cmd /sbin/drbdsetup /dev/drbd0 disk /dev/xvda2 /dev/xvda2 internal --set-defaults --create-device Failed - continuing!
运行:drbdadm create-md MysqL给出:
cltest1:/etc# drbdadm create-md MysqL md_offset 6442446848 al_offset 6442414080 bm_offset 6442217472 Found ext3 filesystem which uses 6291456 kB current configuration leaves usable 6291228 kB 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 /dev/drbd0 v08 /dev/xvda2 internal create-md' terminated with exit code 40 drbdadm aborting
据我所知,我的所有问题都是因为我在xvda2上没有未分配的磁盘空间.