当被监控的应用发生问题时,heartbeat会failover么?

从maillist上别人给出的答案可以看出,如果不做额外的工作,比如,那么heartbeat只有在收不到heartbeat package的时候才会failover,换言之,如果heartbeat的daemon工作正常,但是被监控的服务已经down掉 了,heartbeat也是不会做双机切换的。

需要作一些额外的工作,使得当被监控的服务出现问题时,heartbeat也会切换,如下:

If you want to monitor the apache service with Heartbeat Release 1 then
use Mon from Kernel.org to monitor your services.
If you want to configure heartbeat in Release 2 style you could set up a
monitoring through OCF scripts. For this you should read further on in
the online docs of linux-ha.
You are right. Heartbeat by itself only switches over to the other node,
if it receives no more heartbeat signal of the other node.

Hope that helps...

Achim


Eric Zhang wrote:
> Hi, linux-ha:
>
> I am a newbie of Heartbeat. I have a question now: Will the
> heartbeat failover from primary server to backup server when the
> resource is unavailable? I mean, suppose such a situation: I run Apache
> as my web server and it is the resource that hearbeat will monitor, when
> the primary server was down, the backup server will not hear the
> heartbeat so the failover begins. But if the heartbeat daemon of primary
> server works right but my Apache doesn't work, what will happen? Will
> this trigger a failover event?
>
> Actually, I don't know the details of heartbeat's resource manager.
> Heartbeat's resource manager needs the resource scripts implement
> "status, start, stop" commands, that means I can do a lot of jobs in
> these three commands, I can do a lot of checking works in "status"
> command, if my resource works abnormally, the resource script will
> return words "bad" or some other things, whatever, just no "ok". If so,
> will heartbeat begin failover when my resource script doesn't return
> "ok" or, heartbeat only begin failover when the primary server doesn't
> send heartbeat packages?
>
> I wish everyone can understand me. Thanks for any suggestions.
>
> Eric Zhang
> 2006-11-02
>
>
> _______________________________________________
> Linux-HA mailing list
> Linux-HA@lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems
>
>
原文地址:https://www.cnblogs.com/super119/p/2017836.html