heartbeat 2.x好複雜啊!
今天在作試驗,基於heartbeat 2.x上的HA。
如果使用haresources只能做到系統級別的HA,不能監測到服務狀態。於是改用了cib.xml。
用haresources2cib.py 轉換haresources出來cib.xml。在ha.conf加了個crm yes。結果其相關的服務(smb)就不一定能起來。為什麼說不一定呢?因為在2台都重啟后,過個幾分鐘有幾次smb服務啟動了。
看了一天的heartbeat官方網站,頭暈了!哪位高手幫幫忙看看!
cib.xml
主機2台 lvs lvs1 服務是smb 沒有共享磁碟。heartbeat的VIP192.168.67.222/16 eth1
<cib admin_epoch="0" epoch="1" num_updates="16" have_quorum="true" generated="true" num_peers="1" ccm_transition="1" cib_feature_revision="1.3" dc_uuid="3f471282-3136-4564-87a9-6c612290c8e1" cib-last-written="Thu Nov 30 14:42:47 2006">
<configuration>
<crm_config>
<cluster_property_set id="cib-bootstrap-options">
<attributes>
<nvpair id="cib-bootstrap-options-symmetric_cluster" name="symmetric_cluster" value="true"/>
<nvpair id="cib-bootstrap-options-no_quorum_policy" name="no_quorum_policy" value="stop"/>
<nvpair id="cib-bootstrap-options-default_resource_stickiness" name="default_resource_stickiness" value="0"/>
<nvpair id="cib-bootstrap-options-default_resource_failure_stickiness" name="default_resource_failure_stickiness" value="0"/>
<nvpair id="cib-bootstrap-options-stonith_enabled" name="stonith_enabled" value="false"/>
<nvpair id="cib-bootstrap-options-stonith_action" name="stonith_action" value="reboot"/>
<nvpair id="cib-bootstrap-options-stop_orphan_resources" name="stop_orphan_resources" value="true"/>
<nvpair id="cib-bootstrap-options-stop_orphan_actions" name="stop_orphan_actions" value="true"/>
<nvpair id="cib-bootstrap-options-remove_after_stop" name="remove_after_stop" value="false"/>
<nvpair id="cib-bootstrap-options-short_resource_names" name="short_resource_names" value="true"/>
<nvpair id="cib-bootstrap-options-transition_idle_timeout" name="transition_idle_timeout" value="5min"/>
<nvpair id="cib-bootstrap-options-default_action_timeout" name="default_action_timeout" value="5s"/>
<nvpair id="cib-bootstrap-options-is_managed_default" name="is_managed_default" value="true"/>
</attributes>
</cluster_property_set>
</crm_config>
<nodes>
<node id="af8c5837-cad6-4adc-aaf9-61340c730e96" uname="lvs" type="normal"/>
<node id="3f471282-3136-4564-87a9-6c612290c8e1" uname="lvs1" type="normal"/>
</nodes>
<resources>
<group id="group_1">
<primitive class="ocf" id="IPaddr_192_168_67_222" provider="heartbeat" type="IPaddr">
<operations>
<op id="IPaddr_192_168_67_222_mon" interval="5s" name="monitor" timeout="5s"/>
</operations>
<instance_attributes id="IPaddr_192_168_67_222_inst_attr">
<attributes>
<nvpair id="IPaddr_192_168_67_222_attr_0" name="ip" value="192.168.67.222"/>
<nvpair id="IPaddr_192_168_67_222_attr_1" name="netmask" value="16"/>
<nvpair id="IPaddr_192_168_67_222_attr_2" name="nic" value="eth1"/>
</attributes>
</instance_attributes>
</primitive>
<primitive class="lsb" id="smb_2" provider="heartbeat" type="smb">
<operations>
<op id="smb_2_mon" interval="120s" name="monitor" timeout="60s"/>
</operations>
</primitive>
</group>
</resources>
<constraints>
<rsc_location id="rsc_location_group_1" rsc="group_1">
<rule id="prefered_location_group_1" score="100">
<expression attribute="#uname" id="prefered_location_group_1_expr" operation="eq" value="lvs1"/>
</rule>
</rsc_location>
<rsc_location id="rsc_location_group_2" rsc="group_2">
<rule id="prefered_location_group_2" score="50">
<expression attribute="#uname" id="prefered_location_group_2_expr" operation="eq" value="lvs"/>
</rule>
</rsc_location>
</constraints>
</configuration>
</cib>
《解決方案》
誰能貼一個已經能實際使用的完整的cib.xml參考一下!!!
忽然發現cib.xml內容會被改變,神奇啊~