Home > Archive > Slony1 PostgreSQL Replication > September 2005 > Monitoring slon processes









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Monitoring slon processes
Jim Archer

2005-09-20, 8:24 pm

Hi All...

I was wondering if anyone had any code that monitors a slon and, if it
stops, restarts it? If so, would you be willing to share? I have servers
in other places and, very occasionally, connectivity is briefly lost, which
kills the slon.

Thanks very much...

Jim
Magnus Hagander

2005-09-20, 8:24 pm

> Hi All...
>=20
> I was wondering if anyone had any code that monitors a slon=20
> and, if it stops, restarts it? If so, would you be willing=20
> to share? I have servers in other places and, very=20
> occasionally, connectivity is briefly lost, which kills the slon.
>=20
> Thanks very much...


Couldn't you just run it under a shellscript that automatically restarts
it? Something like:

while [ true ]; do
/path/to/slon -commandline
done

Or start it from init, which will handle respawning and also throttling
if something bad happens..

//Magnus
Jim Archer

2005-09-20, 8:24 pm

--On Tuesday, September 20, 2005 11:30 PM +0200 Magnus Hagander
<mha- +PAb3xVejjn11pZQbBMD
iQ@public.gmane.org> wrote:

> Couldn't you just run it under a shellscript that automatically restarts
> it? Something like:
>
> while [ true ]; do
> /path/to/slon -commandline
> done


If I do that, won't it just start multiple instances of it? Currently, I
have a script that starts it and writes the pid to a pid file (actually, I
flagged the slon to do that). So I was thinking I need something that
would monitor (1) the presence of the pidfile and (2) monitor that the pid
in the pid file is still a process.
Scott Marlowe

2005-09-20, 8:24 pm

On Tue, 2005-09-20 at 16:36, Jim Archer wrote:
> --On Tuesday, September 20, 2005 11:30 PM +0200 Magnus Hagander
> <mha- +PAb3xVejjn11pZQbBMD
iQ@public.gmane.org> wrote:
>
>
> If I do that, won't it just start multiple instances of it? Currently, I
> have a script that starts it and writes the pid to a pid file (actually, I
> flagged the slon to do that). So I was thinking I need something that
> would monitor (1) the presence of the pidfile and (2) monitor that the pid
> in the pid file is still a process.


FYI, someone on this list has recommended daemontools in the past... I
think this is what they were talking about.

http://cr.yp.to/daemontools.html
Thomas Pundt

2005-09-21, 3:24 am

Hi Jim,

On Tuesday 20 September 2005 23:10, Jim Archer wrote:
| I was wondering if anyone had any code that monitors a slon and, if it
| stops, restarts it? If so, would you be willing to share? I have servers
| in other places and, very occasionally, connectivity is briefly lost, which
| kills the slon.

why don't you give the watchdog from the tools/altperl directory a try? I use
it here in our installation and it does a good job.

Ciao,
Thomas

--
Thomas Pundt <thomas.pundt- TxOGGw7xYDWoYr4blSSd
5g@public.gmane.org> ---- http://rp-online.de/ ----
Dennis Jenkins

2005-09-21, 8:24 pm

Well crap. Yahoo ate my attachment. The file is now
posted at http://unwg.no-ip.com/check_slony.pl.txt

Here is my original email:

We wrote a Nagios plugin in perl. Basically, it
checks the "event" table on all nodes to see if each
node has had a SYNC within the past 10 seconds. No
fussing with PIDs and processes. Besides, a PID can
always be recycled by a different process, so if you
check to see if a process with that PID exists, it
might not the the same slony process that you wanted
to check on.

I'm not sure if attachments to this mailing list are
acceptable. If they are not, then kindly tell me and
I'll never do it again.

The attached file is the perl script that we use
inside Nagios (network monitoring software). I coded
it from a skeleton script that did something
completely different for Nagios. The code can be used
by anyone, no strings attached (just don't sue me if
it breaks your systems).

If someone wants to tidy it up and add it to some
"contrib" of either slony or nagios that would be
cool. Too much ambition for me.

--- Jim Archer <jim- p8U4U2pV1R2sTnJN9+BG
Xg@public.gmane.org> wrote:

> Hi All...
>=20
> I was wondering if anyone had any code that monitors
> a slon and, if it=20
> stops, restarts it? If so, would you be willing to
> share? I have servers=20
> in other places and, very occasionally, connectivity
> is briefly lost, which=20
> kills the slon.
>=20
> Thanks very much...
>=20
> Jim
>=20
> ____________________
____________________
_______
> Slony1-general mailing list
> Slony1-general- AuKwsB3Fm+ugFIWk8tvy
RWD2FQJk+8+b@public.gmane.org
>

http://gborg.postgresql.org/mailman.../slony1-general
>=20



Dennis Jenkins
Vivek Khera

2005-09-21, 8:24 pm


On Sep 20, 2005, at 5:42 PM, Scott Marlowe wrote:

> FYI, someone on this list has recommended daemontools in the
> past... I
> think this is what they were talking about.
>
> http://cr.yp.to/daemontools.html
>


musta been me :-)

I have a configurator script that generates the necessary daemontools
configuration.

It works really well since you can start/stop/restart at will and on
unscheduled termination it will auto-restart in a controlled fashion,
ie, with backoff time if it is repeatedly failing, etc.


Vivek Khera, Ph.D.
+1-301-869-4449 x806
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com