[Linux-HA] Heartbeat v2 CIB/API questions
Andrew Beekhof
beekhof at gmail.com
Thu Dec 13 08:04:39 MST 2007
On Dec 13, 2007, at 1:06 PM, Dejan Muhamedagic wrote:
> Hi,
>
> On Wed, Dec 12, 2007 at 08:15:58PM -0500, Scott Mann wrote:
>> Hello,
>>
>> I have just gone from Hearbeat v1 to v2, largely because I needed
>> the autojoin feature. I simply converted my haresources file to a
>> cib.xml with the haresources2cib.py conversion script. I've figured
>> out a few things, but there are other things that I haven't found
>> answers to yet. Please kindly (or rudely) point me to appropriate
>> docs, etc.
>>
>> 1) I'm using an application that I wrote over the heartbeat
>> api. Is there a set of api functions someplace for crm
>> messages/events? I'm looking for a way to programmatically get
>> notified (preferably via callback) of certain events (like a DC
>> change
DC changes are not interesting to you. trust me :-)
>> or a resource transition complete).
>
> Don't think so, though I might be wrong:
no, you're correct.
you can subscribe to updates in general, but not to a specific event.
> that's Andrew's part. At
> any rate, you may take a look at the code of various CRM clients
> (see hg.linux-ha.org/dev). In particular, the SNMP for v2
> hbagent. It's not included in the heartbeat yet, but you may find
> it as an attachment on this list. It's within the last month or
> so.
>
>> 2) I am trying to figure out some of the timing parameters inside
>> of the cib. In particular, can anyone explain the following
>> parameters and the effect they have on a simple Active/Passive
>> managing only an IP address:
>>
>> <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="15s"/>
>> <nvpair id="cib-bootstrap-options-cluster-delay" name="cluster-
>> delay" value="60s"/>
>>
>> and for the IPaddr resource:
>> <op id="IPaddr_192_168_0_98_mon" interval="5s" name="monitor"
>> timeout="5s"/>
>>
>> What effect, if any, do these have on the ha.cf "keepalive",
>> "warntime", "deadtime", and "initdead" directives?
>
> None. Take a look at the DTD for descriptions:
> http://hg.linux-ha.org/dev/file/tip/crm/crm-1.0.dtd
>
> and the output of
>
> /usr/lib/heartbeat/pengine metadata
>
>> I'm seeing about a 2.5minute delay between the time that heartbeat
>> starts and the time that the IP address comes up on eth0:0 (if it
>> were 5minutes, I'd at least have a clue).
>
i depends on your configured deadtime IIRC.
what does ha.cf look like?
> That is strange.
>
>> 3) The following "preference" showed up in the cib.xml as a result
>> of running haresources2cib.py:
>>
>> <constraints>
>> <rsc_location
>> id="rsc_location_IPaddr_192_168_0_98" rsc="IPaddr_192_168_0_98">
>> <rule
>> id="prefered_location_IPaddr_192_168_0_98" score="100">
>> <expression
>> attribute="#uname" id="prefered_location_IPaddr_192_168_0_98_expr"
>> operation="eq" value="paul"/>
>> </rule>
>> </rsc_location>
>> </constraints>
>>
>>
>> Although, this doesn't seem to bother things (there's never a
>> match for "paul," because no such host exists),
>
> In that case your haresources don't match any of the nodes. The
> best would be to replace "paul" with whichever node you may
> prefer.
>
>> when I removed
>> the constraint section in its entirety from cib.xml (with
>> heartbeat shutdown completely on both systems) and restarted
>> heartbeat, it complained and wouldn't restart. I put the
>> constraint section back and all was well again. Is there a
>> proper way to remove that section? Generally, what is the
>> correct way to manage the cib.xml file? I've fooled around with
>> cibadmin (not terribly successfully, yet ;-), but that requires
>> that heartbeat be up and running. Is there a way to edit the
>> file when heartbeat isn't running?
>
> You're not to edit the CIB by hand. If you must (though it's
> infinitely preferable to use cibadmin), then first stop the
> cluster, edit, and remove the .sig files.
an easy way to (effectively) edit by hand without restarting the cluster
cibadmin -Ql > tmp.xml
vi tmp.xml
cibadmin -R -x tmp.xml
>
>
> Thanks,
>
> Dejan
>
>> Thanks, very much,
>>
>>
>> Scott Mann
>> Sr Software Engineer
>> Aztek Networks
>>
>> _______________________________________________
>> Linux-HA mailing list
>> Linux-HA at lists.linux-ha.org
>> http://lists.linux-ha.org/mailman/listinfo/linux-ha
>> See also: http://linux-ha.org/ReportingProblems
> _______________________________________________
> Linux-HA mailing list
> Linux-HA at lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems
More information about the Linux-HA
mailing list