[pgpool-general: 2611] Re: online recovery problem (pgpool_remote_start never ends)
Tatsuo Ishii
ishii at postgresql.org
Mon Mar 10 22:53:34 JST 2014
You specify "ssh -t" which forces to allocate tty. Also you do not
detach stdin, stderr and stdout which cause the script to wait for
something from stdin forever.
Here is the pgpool_remote_start I'm using.
-------------------------------------------------------------------------------
#! /bin/sh
#
# start postmaster on the recovered node
#
if [ $# -ne 2 ]
then
echo "pgpool_remote_start remote_host remote_datadir"
exit 1
fi
DEST=$1
DESTDIR=$2
PGCTL=/usr/local/pgsql/bin/pg_ctl
ssh -T $DEST $PGCTL -w -D $DESTDIR start 2>/dev/null 1>/dev/null < /dev/null &
-------------------------------------------------------------------------------
Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp
> Dear Guys,
>
> I have got a problem...
>
> I started to use pgpool2 3.3 with postgresql 9.3 on Debian 7.3, using the
> pgpool/postgresql repositories.
>
> I have setup a cluster of two pgpool2 nodes and three backend databases. It
> works in a way after setup, but when I started to test the steps that
> should be done for recovery/adding a node, I have ran into the following
> problem:
>
> When pgpool starts the pgpool_remote_start script, it never returns. After
> the end of the scripts, pcp_recovery_node waits until the end of time.
>
> Running the script by hand always work.
>
> postgres at pool-1:~$ /usr/sbin/pcp_recovery_node -d 0 localhost 9898 postgres
> DifficultPassword 2
> DEBUG: send: tos="R", len=46
> DEBUG: recv: tos="r", len=21, data=AuthenticationOK
> DEBUG: send: tos="D", len=6
>
> ... and just waits forever...
>
> Meanwhile the remote postgresql DB is up and running:
>
> postgres at pool-3:~$ /usr/lib/postgresql/9.3/bin/pg_ctl -w -D
> /var/lib/postgresql/9.3/main/ status
> pg_ctl: server is running (PID: 8780)
>
>
> The pgpool_remote_start script is:
> postgres at pool-1:~$ /var/lib/postgresql/pgpool_remote_start pool-3
> /var/lib/postgresql/9.3/main/
> waiting for server to start....2014-03-03 14:33:50 CET LOG: database
> system was shut down at 2014-03-03 14:33:42 CET
> 2014-03-03 14:33:50 CET LOG: database system is ready to accept connections
> 2014-03-03 14:33:50 CET LOG: autovacuum launcher started
> done
> server started
> 2014-03-03 14:33:51 CET LOG: received SIGHUP, reloading configuration files
> Connection to pool-3 closed.
> postgres at pool-1:~$
>
> Here is the script text:
> ----------------------
> #!/bin/sh
>
> /usr/bin/logger Called "$0" "$*"
>
> DEST=$1
> DESTDIR=$2
> PGCTL="/usr/lib/postgresql/9.3/bin/pg_ctl"
>
> COMMAND="ssh -t postgres@$DEST '$PGCTL -w -D $DESTDIR start'"
> /usr/bin/logger -- Trying "$COMMAND"
> eval $COMMAND
> ----------------------
> Attila
More information about the pgpool-general
mailing list