- 论坛徽章:
- 0
|
我最近做了个双机热备,两系统都是linux redhat enterprise as5,heartbeat是2.1.4版本,drbd是8.0.10版本,挂载了一个分区作为drbd的备份分区。
在测试当中,有几种情况经常出现,
1,当双机正常运行时,重启主机,重启后,此主机就不能正常挂载目录了,目录变为只读,不能更改权限,重启后有可能会恢复
2,重启后,双机失去了连接,状态为primary/unknow,用drbdadm connect r0重新建立联系,提示Failure: (125) Device has a net-config (use disconnect first)
Command 'drbdsetup /dev/drbd0 net 192.168.0.100:7898 192.168.0.101:7898 B --set-defaults --create-device --cram-hmac-alg=sha1 --shared-secret=FooFunFactory' terminated with exit code 10
3 在主机接管备机的资源时,有时会出现,heartbeat虚拟地址在主机,而drbd primary状态在备机。
4,有几次出现secondary/secondary状态,次数很少
5 heartbeat启动脚本加载目录时,目录没能加载上
drbd配置文件为:
global { usage-count yes;}
common {syncer {rate 100M;}}
resource r0 {
protocol C;
net {
cram-hmac-alg sha1;
shared-secret "FooFunFactory";
}
on server01 {
device /dev/drbd0;
disk /dev/sda;
address 192.168.0.100:7898;
meta-disk internal;
}
on server02 {
device /dev/drbd0;
disk /dev/sda;
address 192.168.0.101:7898;
meta-disk internal;
}
}
加载的启动脚本
#!/bin/sh
#
# High-Availability Pre-Startup/Shutdown Script
#
#Descriprion:Runs on Startup or shutdown of heartbeat(not resource based)
# Also runs before start,after start or before stop
# and after stop
#
#Author:Matterew Soffen
#
#Support:linux-ha@lists.linux-ha.org
#
#License:GNU Lesser General Public License(LGPL)
#
#Copyright C) 2002 Matthew Soffen
#
#
unset LC_ALL;export LC_ALL
unset LANGUAGE;export LANGUAGE
prefix=/usr
exec_prefix=/usr
./etc/ha.d/shellfuncs
case "$1" in
'start')
# /sbin/drbdadm -- --do-what-l-say primary all
#/sbin/drbdadm primary r0
/sbin/drbdadm primary r0
#drbdsetup /dev/drbd1 primary -o
/bin/mount /dev/drbd0 /data
;;
'pre-start')
;;
'post-start')
;;
'stop')
/bin/umount /data
/sbin/drbdadm secondary r0
;;
'pre-stop')
;;
'post-stop')
;;
*)
echo "Usage 0 {start|pre-start|post-start|stop|pre-stop|post-stop}"
;;
esac
exit 0
这是我测试过程中都曾见过的现在,不知道有谁也测试过,大家一起来讨论讨论,怎么解决 |
|