Re: PITR Based replication ...

From: Robin Iddon <robin(at)edesix(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: PITR Based replication ...
Date: 2006-04-05 21:26:43
Message-ID: 44343613.1050304@edesix.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin


> Anyone have any suggestions on novel phrases to offer in my incantations for
> getting this script to do everything I need?
You need to add "-l $LOGFILE" where log is wherever you want to write
the stderr+stdout from the postmaster to. Then it will return once
starting the server.

> Also, is there any way, in the case of shutting down the
> production instance for the second pass, to have the shutdown command wait
> indefinitely? "-m smart" will give up after waiting so long, and I'd like
> neither to interrupt any running jobs, nor end up not taking a backup in the
> event a running job outlasts pg_ctl's timeout.
>
>
Not that I know of, but you can poll the server status using the same
pg_ctl command constructs as you're using already but with "status"
instead of "stop" or "start". pg_ctl (and hence ssh) will return 0 if
the server is running and 1 if the server is no running.

So you could try something like

while ssh $REMOTE pg_ctl -D $CLUSTER status
do
echo "Remote server still running - continuing to wait ..."
sleep 10
done

Hope this helps,

Robin

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Jim Nasby 2006-04-05 21:59:40 Re: pg_stat_activity showing non-existent processes
Previous Message Rosser Schwarz 2006-04-05 18:26:13 Re: PITR Based replication ...