On 7 July 2014 18:39, Sasi <[email protected]> wrote: > In distributed systems that uses Apache Zookeeper for co-ordination, each > component is a client to the Zookeeper server, and it instantiates a > zookeeper instance, which in the background is sending heartbeats to the > zookeeper server. I understand that the time interval for heartbeat > communication is configurable. In situations when the "component" itself > goes into a "faulty" state but the "heartbeats" to zookeeper is good and > unaffected, proper state of this component is not communicated to the rest > of the components in the system. > > Is it possible out of the box, to influence the heartbeat mechanism - > typically by passing a "status reporting function" to the zookeeper > instance > - to "validate" the status of the component before sending the heartbeat ? >
I don't think so — pings are hard-coded into the protocol and you can't add payload to them. You'd probably be better off having a thread which does the health-check of your component and then kills the ZK session if the health-check failed. -rgs
