[Linux-HA] Heartbeat v2 CIB/API questions
smann at azteknetworks.net
Thu Dec 13 12:11:49 MST 2007
On Thu 12/13/2007 8:04 AM, Andrew Beekhof said:
>On Dec 13, 2007, at 1:06 PM, Dejan Muhamedagic wrote:
>> On Wed, Dec 12, 2007 at 08:15:58PM -0500, Scott Mann wrote:
>>> 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
>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
Thanks for this. It is a lot of help and I didn't see it before (or
the one you mention below) in my searches.
>>> 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"
>>> 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:
>> 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?
Here's my ha.cf:
serial /dev/ttyS0 # Linux
mcast eth0 220.127.116.11 694 1 0
apiauth azClient uid=root,smann
>> That is strange.
>>> 3) The following "preference" showed up in the cib.xml as a result
>>> of running haresources2cib.py:
>>> id="rsc_location_IPaddr_192_168_0_98" rsc="IPaddr_192_168_0_98">
>>> id="prefered_location_IPaddr_192_168_0_98" score="100">
>>> attribute="#uname" id="prefered_location_IPaddr_192_168_0_98_expr"
>>> operation="eq" value="paul"/>
>>> 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
>>> 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
>cibadmin -R -x tmp.xml
Hey! This works! Thanks, again!
>>> Thanks, very much,
>>> Scott Mann
>>> Sr Software Engineer
>>> Aztek Networks
>>> Linux-HA mailing list
>>> Linux-HA at lists.linux-ha.org
>>> See also: http://linux-ha.org/ReportingProblems
>> Linux-HA mailing list
>> Linux-HA at lists.linux-ha.org
>> See also: http://linux-ha.org/ReportingProblems
>Linux-HA mailing list
>Linux-HA at lists.linux-ha.org
>See also: http://linux-ha.org/ReportingProblems
Linux-HA mailing list
Linux-HA at lists.linux-ha.org
See also: http://linux-ha.org/ReportingProblems
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 5590 bytes
Desc: not available
More information about the Linux-HA