免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4772 | 回复: 1
打印 上一主题 下一主题

请教heartbeat+drbd+mysql的一个问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-08-31 11:07 |只看该作者 |倒序浏览
操作系统:centos 5.6 64bit
机器2台:MYSQLM1 和MYSQLM2
MYSQLM1 为primary
MYSQLM2 为secondary
2台机器etc/hosts的配置如下

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               MYSQLM2 localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6
172.17.94.210   MYSQLM2                 node2 #MYSQLM1 此处修改下。
172.17.94.209  node1                    

heartbeat在2台机器的ha.cf配置如下:
debugfile /var/log/ha-debug
logfile /var/log/ha-log
logfacility local0
keepalive 2
deadtime 20
warntime 10
initdead 60
udpport 693
#ucast eht0 172.17.94.210
ping_group group1 172.17.94.209 172.17.94.210
auto_failback off
node MYSQLM1
node MYSQLM2
#respawn hacluster /usr/lib/heartbeat/ipfail
#apiauth ipfail gid=haclient uid=hacluster
hopfudge 1
haresources的配置文件如下:
2台机器的配置都一样。默认MYSQLM1为primary.虚拟IP为172.17.94.208,IP都设在eth0:0上。
MYSQLM1 drbddisk Filesystem::/dev/drbd0::/data::ext3 mysqld 172.17.94.208
heartbeat的resource.d目录下写的mysql如下:
#!/bin/bash
. /etc/ha.d/shellfuncs
case "$1" in
start)
   res='/etc/init.d/mysqld start'
   ret=$?
   ha_log $res
   exit $ret
   ;;
stop)
   res='/etc/init.d/mysqld stop'
   ret=$?
   ha_log $res
   exit $ret
   ;;
status)
   if [['ps -ef|grep '[m]ysqld''>1]];then
      echo "running"
   else
      echo "stopped"
   fi
   ;;
*)
   echo "Usage:mysqld {start|stop|status}"
   exit 1
   ;;
esac
exit 0

问题:
MYSQLM2的heartbeat日志:

heartbeat[2829]: 2011/08/31_10:57:26 CRIT: send_to_all_media: No working comm channels to write to.
heartbeat[2829]: 2011/08/31_10:57:28 CRIT: send_to_all_media: No working comm channels to write to.
heartbeat[2829]: 2011/08/31_10:57:30 CRIT: send_to_all_media: No working comm channels to write to.
heartbeat[2829]: 2011/08/31_10:57:32 CRIT: send_to_all_media: No working comm channels to write to.
heartbeat[2829]: 2011/08/31_10:57:34 CRIT: send_to_all_media: No working comm channels to write to.
heartbeat[2829]: 2011/08/31_10:57:34 CRIT: send_to_all_media: No working comm channels to write to.
heartbeat[2829]: 2011/08/31_10:57:36 CRIT: send_to_all_media: No working comm channels to write to.
heartbeat[2829]: 2011/08/31_10:57:38 CRIT: send_to_all_media: No working comm channels to write to.
heartbeat[2829]: 2011/08/31_10:57:40 CRIT: send_to_all_media: No working comm channels to write to.
heartbeat[2829]: 2011/08/31_10:57:42 CRIT: send_to_all_media: No working comm channels to write to.

1,为什么MYSQLM1我ifdown eth0之后,MYSQLM2的权限从secondary升级到primary需要重起机器才能获得权限?
希望路过有经验的能帮忙看看。
谢谢!

论坛徽章:
0
2 [报告]
发表于 2011-09-01 09:29 |只看该作者
在MYSQLM1上执行ifdown eth0.查看MYSQLM2的heartbeat日志。提示如下:
Resource
Manager[3271]:  2011/09/01_09:23:36 info: Releasing resource group: mysqlm1 IPADDR::172.17.94.208/24/eth0:0 drbddisk::r0 Filesystem::/dev/drbd0::/data::ext3 mysqld
ResourceManager[3271]:  2011/09/01_09:23:36 info: Running /etc/ha.d/resource.d/mysqld  stop
ResourceManager[3271]:  2011/09/01_09:23:36 ERROR: Cannot locate resource script Filesystem
ResourceManager[3271]:  2011/09/01_09:23:36 ERROR: Cannot locate resource script Filesystem
ResourceManager[3271]:  2011/09/01_09:23:37 info: Retrying failed stop operation [Filesystem::/dev/drbd0::/data::ext3]
ResourceManager[3271]:  2011/09/01_09:23:37 ERROR: Cannot locate resource script Filesystem
ResourceManager[3271]:  2011/09/01_09:23:37 ERROR: Cannot locate resource script Filesystem
ResourceManager[3271]:  2011/09/01_09:23:38 info: Retrying failed stop operation [Filesystem::/dev/drbd0::/data::ext3]
ResourceManager[3271]:  2011/09/01_09:23:38 ERROR: Cannot locate resource script Filesystem
ResourceManager[3271]:  2011/09/01_09:23:38 ERROR: Cannot locate resource script Filesystem

1:为什么MYSQLM2没有获取primary权限,谢谢!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP