monit-general
[Top][All Lists]
Advanced

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

Re: Steadying monitoring processes without starting them


From: Martin Pala
Subject: Re: Steadying monitoring processes without starting them
Date: Sun, 15 May 2016 16:10:49 +0200

Hi Sandy,

the next Monit release (5.18) has a new statement to set a service startup behaviour when monit is started. Manual excerpt:

--8<--
SYSTEM REBOOT AND SERVICE STARTUP

Monit supports three reboot modes: start, nostart and laststate.

Syntax:

  ONREBOOT <START | NOSTART | LASTSTATE>

In start mode (DEFAULT), Monit will always start the service automatically
on reboot, even if it was stopped before it.

In nostart mode, the service is I<never> started automatically after reboot.
This mode is intended for a high-availability solutions with active/passive clusters.
For example: the service group HA is started on machine M1, the machine M2 is backup,
heartbeat is in place between both machines. The service group HA (such as an mobile
IP alias + application server). must be started on one node only. When M1 dies,
M2 takes HA group over, but if M1 reboots, it is important that it won't try to start
the HA group too (even though it was active on M1 before it crashed), as HA is running
on M2 now.

In laststate mode, a service monitoring state is persistent across reboot, i.e. if
the service was started before reboot, it'll be started after reboot too and vice versa.
--8<--

In you case you can use the "nostart" onreboot mode - in this mode, Monit won't monitor the service on reboot. The master can then start the service using "monit start <myservice>" (or just "monit monitor <myservice>") - monit will then make sure the service is up and running.

Regards,
Martin



On 14 May 2016, at 19:17, Sandy C <address@hidden> wrote:

Hi Dominic,

Thanks for the reply and for the decoding of type-o's - typed the email on a phone.

But the suggestion doesn't quite address the use case we are trying to get to if I am understanding it correctly.

Maybe I am thinking about this wrong.  Here is a short background/outer use case:

We are orchestrating a cluster (a bunch of machines) with various app stacks that have all the colors of the rainbow when it comes to start/stop/management.  Some app stacks can start on N nodes independently while some are very sequential and start only from a single master.  Such as say hadoop or accumulo.

So for this latter camp, say accumulo, we can use monit to start/monitor/manage the master node which will start the slave apps (tservers) on the slave nodes.

The difficulty is figuring out how to start monit on the slave nodes such that it will NOT start the tserver process but will only monitor it once it is up, and then restart it if it goes down.

But, we do not want the monit on the slave to bring up the tserver until the master brings it up.  Which could be days/weeks/ a long time.

The goal was to do this without having to manage monit itself (as it take monit down or have monit reload new config files when/if the accumulo master starts).

But I can't yet see how to make that happen.

Hope this helps.  Thanks in advance for additional replies (from anyone).

-sandy

On May 13, 2016, at 14:13, Dominic Harkness <address@hidden> wrote:

You may be able to add a condition like "if does not exist" that will override the restart if the process isn't running. I'm not sure if you can avoid monit logging every time it sees the process does not exist, though.

For example, if you want monit to double check before issuing a restart you could say: "if does not exist for 2 cycles then restart". It will log that the process was not running in the first cycle and then restart the process if it's not running in the second cycle as well.

Hope that helps!
Dominic


--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general


reply via email to

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