From: H. Hall <hhall1001@reedyriver.com>
To: jd@commandprompt.com, Mischa Sandberg <mischa_sandberg@telus.net>
To: pgsql-admin@postgresql.org
Subject: Re: Reliably determining whether the server came up
Date: Sun, 16 Nov 2008 07:02:32 -0500
Message-ID: <49200BD8.4060703@reedyriver.com> (raw)
In-Reply-To: <1226781115.22056.1.camel@jd-laptop.pragmaticzealot.org>
References: <1226527535.491b532f4c45e@legacywebmail.telus.net>
<491F1861.4060403@reedyriver.com>
<1226780945.491f3111e22de@legacywebmail.telus.net>
<1226781115.22056.1.camel@jd-laptop.pragmaticzealot.org>
Joshua D. Drake wrote:
> On Sat, 2008-11-15 at 12:29 -0800, Mischa Sandberg wrote:
>
>> Quoting "H. Hall" <hhall1001@reedyriver.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 . . .
Hmmm.
--cheers, HH
--
H. Hall
ReedyRiver Group LLC
www.reedyriver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: hhall1001@reedyriver.com, mischa_sandberg@telus.net
Subject: Re: Reliably determining whether the server came up
In-Reply-To: <49200BD8.4060703@reedyriver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox