Skip site navigation (1) Skip section navigation (2)

Re: Reliably determining whether the server came up

From: "H(dot) Hall" <hhall1001(at)reedyriver(dot)com>
To: jd(at)commandprompt(dot)com, Mischa Sandberg <mischa_sandberg(at)telus(dot)net>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Reliably determining whether the server came up
Date: 2008-11-16 12:02:32
Message-ID: (view raw or whole thread)
Lists: pgsql-admin
Joshua D. Drake wrote:
> On Sat, 2008-11-15 at 12:29 -0800, Mischa Sandberg wrote:
>> Quoting "H. Hall" <hhall1001(at)reedyriver(dot)com>:
>>> Mischa Sandberg wrote:
>>>> I've been trying to work out a reliable script to determine, 
>>>> after pg_ctl start, that the server is done attempting
>>>> to come up, and that it has either succeeded OR FAILED.
>>>> This is for several hundred unattended appliance-type servers,
>>>> currently on PG 8.0 but soon to be on 8.3
>>> Why don't you try to create a connection to a db on each server?
>> Thanks, but that only tells me if the server is up at the time of trying
>> to connect.
> Actually it doesn't. If you are using any standard library to connect if
> the server is not ready to accept connections, it will tell you when you
> connect. If the server failed to come up, you won't get a connection at
> all, if you try to connect and you are able to connect but not initiate
> a session and appropriate response will be sent.
> Joshua D. Drake
Exactly. :-)
Also, once you take a look at your solution code a light bulb may go 
off. Hey! This code could also be used to test the health of my db 
servers during production!  If I just execute it in a timer thread . . . 
--cheers, HH

H. Hall
ReedyRiver Group LLC

In response to


pgsql-admin by date

Next:From: Gerd K├ÂnigDate: 2008-11-17 10:35:03
Subject: move from mysql to postgresql
Previous:From: Joshua D. DrakeDate: 2008-11-15 20:31:55
Subject: Re: Reliably determining whether the server came up

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group