pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Init script for multiple postmasters
3+ messages / 3 participants
[nested] [flat]

* Init script for multiple postmasters
@ 2006-05-22 11:16 Nicola Mauri <Nicola.Mauri@saga.it>
  2006-05-22 12:33 ` Re: Init script for multiple postmasters Alvaro Herrera <alvherre@commandprompt.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Nicola Mauri @ 2006-05-22 11:16 UTC (permalink / raw)
  To: pgsql-admin

Hi,
I'm trying to set up two postmasters on a two-node redhat cluster.

Instance #1:
  pg_data: /var/lib/pgsql/data 
  user: postgres
Instance #2:
  pg_data: /var/lib/pgsql2/data2 
  user: postgres2

Since databases are managed by cluster manager I need two different 
initscripts. Unfortunately the script provided in the rpm uses the 
'status' function which does not make difference between two groups of 
processes:
$ /etc/init.d/postgresql  status
postmaster (pid 5320 5319 5318 5316 5314) is running...
$ /etc/init.d/postgresql2  status
postmaster (pid 5320 5319 5318 5316 5314) is running...

In this scenario the cluster manager cannot determine wether a single 
instance is running or down.
I'm going to modify initscripts and use a differente approach to probe 
postmasters status, but I'm not sure if this is good:

ps ax | grep postmaster | grep /var/lib/pgsql2/data2
ps ax | grep postmaster | grep /var/lib/pgsql/data

What would you suggest?
Thanks
Nicola

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Init script for multiple postmasters
  2006-05-22 11:16 Init script for multiple postmasters Nicola Mauri <Nicola.Mauri@saga.it>
@ 2006-05-22 12:33 ` Alvaro Herrera <alvherre@commandprompt.com>
  2006-05-22 13:30   ` Re: Init script for multiple postmasters Ola Sandbu <ola.sandbu@usit.uio.no>
  0 siblings, 1 reply; 3+ messages in thread

From: Alvaro Herrera @ 2006-05-22 12:33 UTC (permalink / raw)
  To: Nicola Mauri <Nicola.Mauri@saga.it>; +Cc: pgsql-admin

Nicola Mauri wrote:

> In this scenario the cluster manager cannot determine wether a single 
> instance is running or down.
> I'm going to modify initscripts and use a differente approach to probe 
> postmasters status, but I'm not sure if this is good:
> 
> ps ax | grep postmaster | grep /var/lib/pgsql2/data2
> ps ax | grep postmaster | grep /var/lib/pgsql/data
> 
> What would you suggest?

pg_ctl -d /var/lib/pgsql2/data2 status

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Init script for multiple postmasters
  2006-05-22 11:16 Init script for multiple postmasters Nicola Mauri <Nicola.Mauri@saga.it>
  2006-05-22 12:33 ` Re: Init script for multiple postmasters Alvaro Herrera <alvherre@commandprompt.com>
@ 2006-05-22 13:30   ` Ola Sandbu <ola.sandbu@usit.uio.no>
  0 siblings, 0 replies; 3+ messages in thread

From: Ola Sandbu @ 2006-05-22 13:30 UTC (permalink / raw)
  To: Nicola Mauri <Nicola.Mauri@saga.it>; pgsql-admin



On 05/22/2006 02:33 PM, Alvaro Herrera wrote:
> Nicola Mauri wrote:
> 
>> In this scenario the cluster manager cannot determine wether a single 
>> instance is running or down.
>> I'm going to modify initscripts and use a differente approach to probe 
>> postmasters status, but I'm not sure if this is good:
>>
>> ps ax | grep postmaster | grep /var/lib/pgsql2/data2
>> ps ax | grep postmaster | grep /var/lib/pgsql/data
>>
>> What would you suggest?
> 
> pg_ctl -d /var/lib/pgsql2/data2 status
> 
My experience is that you can not know if the database is running or has 
died by only checking the status flag. But if you combines these two, by 
checking the PID process ID from the pg_ctl command and then use 'ps 
-ax' to see that this process is really alive, then you have a proof.

rgds Ola Sandbu



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2006-05-22 13:30 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-05-22 11:16 Init script for multiple postmasters Nicola Mauri <Nicola.Mauri@saga.it>
2006-05-22 12:33 ` Alvaro Herrera <alvherre@commandprompt.com>
2006-05-22 13:30   ` Ola Sandbu <ola.sandbu@usit.uio.no>

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