当前位置: 首页 > HA, Linux > 正文

禁用cman中的fence

原意是想验证一下 gfs2, 使用 pacemaker + cman 搭建了一套cluster

为了方便起见,没有配置fnece,木有想到cman小朋友停不下来了

看了一下日志,它在停止的时候,还要fence掉一个没有起动cman的节点

    Jul 24 17:14:37 fenced fencing node node1 still retrying
    Jul 24 17:44:47 fenced fencing node node1 still retrying
    Jul 24 18:14:56 fenced fencing node node1 still retrying
    Jul 24 18:45:07 fenced fencing node node1 still retrying
    Jul 24 19:15:17 fenced fencing node node1 still retrying
    Jul 24 19:45:28 fenced fencing node node1 still retrying
    Jul 24 19:59:12 fenced fencing node node1 still retrying

当然不能成功了,最后导致超时,报错退出了

唉,算了,我们自己配置一个假装的fence设备,骗一下cman好了

    vi /sbin/myfence

    内容如下:
    #!/bin/bash
    echo "success: myfence $2"
    exit 0

ok,给cluster.conf中添加fence设备和方法,最终cluster.conf如下

  <?xml version="1.0"?>
  <cluster config_version="1" name="mycluster"> 
      <clusternodes>
	  <clusternode name="node1" nodeid="1">
	      <fence>
		  <method name="1">
		      <device nodename="node1" name="myfence"/>
		  </method>
	      </fence>
	  </clusternode>

	  <clusternode name="node2" nodeid="2">
	      <fence>
		  <method name="2">
		      <device nodename="node2" name="myfence"/>
		  </method>
	      </fence>
	  </clusternode>

	  <clusternode name="node3" nodeid="3">
	      <fence>
		  <method name="3">
		      <device nodename="node3" name="myfence"/>
		  </method>
	      </fence>
	  </clusternode>
      </clusternodes>

      <fencedevices>
	  <fencedevice agent="myfence" name="myfence"/>
      </fencedevices>
      <rm/>
  </cluster>

ok, 再次停止cman试试

    Jul 24 20:03:25 fenced fenced 3.0.12.1 started
    Jul 24 20:03:32 fenced fencing node node1
    Jul 24 20:03:32 fenced fence node1 success
    Jul 24 20:03:32 fenced fencing node node3
    Jul 24 20:03:32 fenced fence node3 success

每当cman需要fence的时候,我们的脚本直接告诉它fence成功了

注意:

fence在一个集群中特别重要,这也是cman为什么必须要有fence才能工作的原因了

没有特殊原因,请不要禁用fence!

That’s all

    分享到:

本文固定链接: http://klwang.info/disable-fence-in-cman/ | 数据库|Linux|软件开发

该日志由 klwang 于2013年07月26日发表在 HA, Linux 分类下, 你可以发表评论,并在保留原文地址及作者的情况下引用到你的网站或博客。
原创文章转载请注明: 禁用cman中的fence | 数据库|Linux|软件开发
关键字: , , , , , ,

禁用cman中的fence:等您坐沙发呢!

发表评论

*
快捷键:Ctrl+Enter