monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Forcing hb-standby with heartbeat when local process in not recovera


From: Martin Pala
Subject: Re: Forcing hb-standby with heartbeat when local process in not recoverable
Date: Wed, 06 Dec 2006 00:31:38 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060809 Debian/1.7.13-0.3

Yes, something like that could be useful. Optionaly it could be possible to add the possibility to override the default restart action on the process nonexistence event and allow to stack the rules, such as:

--8<--
 check process apache ...
  start program = "/etc/init.d/httpd start"
  stop program = "/etc/init.d/httpd stop"
  if failed existence for 1 cycle then restart
if failed existence for 3 cycles then exec "/usr/lib/heartbeat/hb_standby"
--8<--

The fourth line equals to the implicit restart on process failure and most probebly may be omited. The fifth line allows to set the watermark - in the case that the process doesn't exist for 5 cycles, then make the node standby.


Martin



address@hidden wrote:
Hello,

I have a question regarding the usage of monit and heartbeat.
The monit-readme contains the following statements :

 ... "With this sequence, there should be no error-case, which is
not handled either by heartbeat or by monit. For example, if monit dies,
initd restarts it. If heartbeat dies, monit restarts it. If the node
dies, the heartbeat instance on the other node detects it and restart
the services there."

But what happens, if a service ( for example Apache ) can't be restarted
locally by monit, because something went wrong with configuration files
etc ?
Then the service would not be accessible any more, because the virtual
address is
still on the failed node. Wouldn't it be a good idea to have something
like:

IF NUMBER RESTART NUMBER CYCLE(S) THEN ACTION, where ACTION could be
EXEC and not only TIMEOUT ?

Then it would be possible to exec "hb_standby" if Apache could not be
restarted for 3 times within 3 cycles

 check process apache
           with pidfile "/usr/local/apache/logs/httpd.pid"
           start program = "/etc/init.d/httpd start"
           stop program = "/etc/init.d/httpd stop"
           if 3 restarts within 3 cycles then exec
"/usr/lib/heartbeat/hb_standby"


Or is there a better way to achieve this ?

I know that heartbeat 2.x can do ressource monitoring, but I have to
rely on heartbeat 1.2.3 for several reasons.

Thanks for your help in advance

Best regards

Tim





reply via email to

[Prev in Thread] Current Thread [Next in Thread]