LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 852|回复: 0

请教cib

[复制链接]
发表于 2007-12-13 12:43:34 | 显示全部楼层 |阅读模式
我用cib.xml来配置heartbeat,如下所示:

  1. <cib admin_epoch="0" generated="true" have_quorum="true" ignore_dtd="false" num_peers="2" cib_feature_revision="2.0" ccm_transition="2" dc_uuid="b02eb352-15d5-4234-b38b-9f6693163ea6" epoch="8" num_updates="1" cib-last-written="Thu Dec 13 23:18:21 2007">
  2.    <configuration>
  3.      <crm_config>
  4.        <cluster_property_set id="cib-bootstrap-options">
  5.          <attributes>
  6.            <nvpair id="cib-bootstrap-options-symmetric-cluster" name="symmetric-cluster" value="true"/>
  7.            <nvpair id="cib-bootstrap-options-no-quorum-policy" name="no-quorum-policy" value="stop"/>
  8.            <nvpair id="cib-bootstrap-options-default-resource-stickiness" name="default-resource-stickiness" value="0"/>
  9.            <nvpair id="cib-bootstrap-options-default-resource-failure-stickiness" name="default-resource-failure-stickiness" value="0"/>
  10.            <nvpair id="cib-bootstrap-options-stonith-enabled" name="stonith-enabled" value="false"/>
  11.            <nvpair id="cib-bootstrap-options-stonith-action" name="stonith-action" value="reboot"/>
  12.            <nvpair id="cib-bootstrap-options-startup-fencing" name="startup-fencing" value="true"/>
  13.            <nvpair id="cib-bootstrap-options-stop-orphan-resources" name="stop-orphan-resources" value="true"/>
  14.            <nvpair id="cib-bootstrap-options-stop-orphan-actions" name="stop-orphan-actions" value="true"/>
  15.            <nvpair id="cib-bootstrap-options-remove-after-stop" name="remove-after-stop" value="false"/>
  16.            <nvpair id="cib-bootstrap-options-short-resource-names" name="short-resource-names" value="true"/>
  17.            <nvpair id="cib-bootstrap-options-transition-idle-timeout" name="transition-idle-timeout" value="5min"/>
  18.            <nvpair id="cib-bootstrap-options-default-action-timeout" name="default-action-timeout" value="15s"/>
  19.            <nvpair id="cib-bootstrap-options-is-managed-default" name="is-managed-default" value="true"/>
  20.            <nvpair id="cib-bootstrap-options-cluster-delay" name="cluster-delay" value="60s"/>
  21.            <nvpair id="cib-bootstrap-options-pe-error-series-max" name="pe-error-series-max" value="-1"/>
  22.            <nvpair id="cib-bootstrap-options-pe-warn-series-max" name="pe-warn-series-max" value="-1"/>
  23.            <nvpair id="cib-bootstrap-options-pe-input-series-max" name="pe-input-series-max" value="-1"/>
  24.            <nvpair id="cib-bootstrap-options-dc-version" name="dc-version" value="2.1.3-node: b42542bc75cb615fbf1c9674085f8c73f14145ca"/>
  25.          </attributes>
  26.        </cluster_property_set>
  27.      </crm_config>
  28.      <nodes>
  29.        <node id="b02eb352-15d5-4234-b38b-9f6693163ea6" uname="node1" type="normal"/>
  30.        <node id="67cc7b4a-ef20-42fb-98f7-cbf2a823c6a8" uname="node0" type="normal"/>
  31.      </nodes>
  32.      <resources>
  33.        <primitive class="ocf" id="ipaddr_1" provider="heartbeat" type="IPaddr">
  34.          <operations>
  35.            <op id="ipaddr_1_mon" interval="5s" name="monitor" timeout="5s"/>
  36.          </operations>
  37.          <instance_attributes id="ipaddr_1_inst_attr">
  38.            <attributes>
  39.              <nvpair id="ipaddr_1_attr_0" name="ip" value="192.168.0.20"/>
  40.              <nvpair id="ipaddr_1_attr_1" name="cidr_netmask" value="24"/>
  41.            </attributes>
  42.          </instance_attributes>
  43.        </primitive>
  44.        <master_slave id="drbd_2">
  45.          <meta_attributes id="drbd_2_meta_attr">
  46.            <attributes>
  47.              <nvpair id="drbd_2_clone_max" name="clone_max" value="2"/>
  48.              <nvpair id="drbd_2_clone_node_max" name="clone_node_max" value="1"/>
  49.              <nvpair id="drbd_2_master_max" name="master_max" value="1"/>
  50.              <nvpair id="drbd_2_master_node_max" name="master_node_max" value="1"/>
  51.              <nvpair id="drbd_2_notify" name="notify" value="yes"/>
  52.              <nvpair id="drbd_2_globally_unique" name="globally_unique" value="false"/>
  53.              <nvpair id="drbd_2_target_role" name="target_role" value="started"/>
  54.            </attributes>
  55.          </meta_attributes>
  56.          <primitive class="ocf" id="drbd_2_prtv" provider="heartbeat" type="drbd">
  57.            <operations>
  58.              <op id="drbd_2_mon" interval="120s" name="monitor" timeout="60s"/>
  59.            </operations>
  60.            <instance_attributes id="drbd_2_inst_attr">
  61.              <attributes>
  62.                <nvpair id="drbd_2_resource" name="drbd_resource" value="drbd0"/>
  63.              </attributes>
  64.            </instance_attributes>
  65.          </primitive>
  66.        </master_slave>
  67.        <primitive class="ocf" id="filesystem_3" provider="heartbeat" type="Filesystem">
  68.          <meta_attributes id="filesystem_3_meta_attr">
  69.            <attributes>
  70.              <nvpair name="target_role" id="filesystem_3_ma_attr_0" value="started"/>
  71.            </attributes>
  72.          </meta_attributes>
  73.          <operations>
  74.            <op id="filesystem_3_mon" interval="120s" name="monitor" timeout="60s"/>
  75.          </operations>
  76.          <instance_attributes id="filesystem_3_inst_attr">
  77.            <attributes>
  78.              <nvpair id="filesystem_3_attr_0" name="device" value="/dev/drbd0"/>
  79.              <nvpair id="filesystem_3_attr_1" name="directory" value="/mnt/md"/>
  80.              <nvpair id="filesystem_3_attr_2" name="fstype" value="ext3"/>
  81.            </attributes>
  82.          </instance_attributes>
  83.        </primitive>
  84.        <primitive class="ocf" id="Pure-FTPd_4" provider="heartbeat" type="Pure-FTPd">
  85.                                         <operations>
  86.                                                 <op id="Pure-FTPd_4_mon" interval="120s" name="monitor" timeout="60s"/>
  87.                                         </operations>
  88.                          </primitive>
  89.      </resources>
  90.      <constraints>
  91.        <rsc_order id="rsc_order_drbd_fs" from="filesystem_3" action="start" type="after" to="drbd_2" symmetrical="true"/>
  92.        <rsc_order id="rsc_order_ipaddr_pureftpd" from="ipaddr_1" action="start" type="before" to="Pure-FTPd_4" symmetrical="true"/>
  93.        <rsc_location rsc="ipaddr_1" id="rsc_location_ipaddr">
  94.          <rule id="prefered_location_ipaddr_1" score="100">
  95.            <expression attribute="#uname" id="prefered_location_ipaddr_1_expr" operation="eq" value="node0"/>
  96.          </rule>
  97.        </rsc_location>
  98.        <rsc_location rsc="drbd_2" id="rsc_location_drbd">
  99.          <rule id="prefered_location_drbd" role="master" score="100">
  100.            <expression attribute="#uname" id="prefered_location_drbd_expr" operation="eq" value="node0"/>
  101.          </rule>
  102.        </rsc_location>
  103.        <rsc_location rsc="filesystem_3" id="rsc_location_filesystem_3">
  104.          <rule id="prefered_location_filesystem_3" score="100">
  105.            <expression attribute="#uname" id="prefered_location_filesystem_3_expr" operation="eq" value="node0"/>
  106.          </rule>
  107.        </rsc_location>
  108.        <rsc_location rsc="Pure-FTPd_4" id="rsc_location_Pure-FTPd_4">
  109.          <rule id="prefered_location_Pure-FTPd_4" score="100">
  110.            <expression attribute="#uname" id="prefered_location_Pure-FTPd_4_expr" operation="eq" value="node0"/>
  111.          </rule>
  112.        </rsc_location>
  113.      </constraints>
  114.    </configuration>
  115. </cib>

复制代码

环境:
os为Debian Etch,分别为node0和node1,其中node0为主用服务器。
有四个资源,分别为IPaddr, drbd, filesystem和pure-ftpd.
按照我的配置,已经可以启动ipaddr, drbd和pure-ftpd了,但是filesystem去无法成功。
我单独使用ocf-tester -v -n filesystem_3 ...已经通过了测试,说明该ocf RA是可以正常工作的,所以可以肯定的是配置文件写错了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表