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

Facing issue in online recovery of pgpool-II

From: Saurabh <saurabh(dot)b85(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Facing issue in online recovery of pgpool-II
Date: 2012-02-02 10:26:13
Message-ID: bb584301-d6cc-4ed4-a553-4a695d918df5@db5g2000vbb.googlegroups.com (view raw or flat)
Thread:
Lists: pgsql-general
Hi all,

I am using postgresql streaming replication for my project. For
automatic failover and online recovery I am trying to use pgpool-II.
Failover is working fine. But in online recovery I am facing issue.
When I am trying to recover master node (which was down earlier) as
slave node then master gets up as master not as slave node. Following
is the configuration

Postgresql.conf (Slave)

wal_level = archive
archive_mode = on
archive_command = 'cp -i %p /home/postgres/archive/%f'
hot_standby = on

Postgresql.conf (Master)

wal_level = hot_standby
archive_mode = on
archive_command = 'cp -i %p /home/postgres/archive/%f'
max_wal_senders = 10
wal_keep_segments = 32
hot_standby = on

Pgpool-II configuration

# online recovery user
recovery_user = 'postgres'

# online recovery password
recovery_password = ''

# execute a command in first stage.
recovery_1st_stage_command = 'basebackup.sh'

# execute a command in second stage.
recovery_2nd_stage_command = ''

Basebackup.sh

psql -p $PORT -c "SELECT pg_start_backup('Streaming Replication',
true)" postgres

rsync -C -a -c --delete --exclude postgresql.conf --exclude
postmaster.pid \
--exclude postmaster.opts --exclude pg_log \
--exclude recovery.conf --exclude recovery.done \
--exclude pg_xlog \
$SOURCE_CLUSTER/ $DEST_CLUSTER/

mkdir $DEST_CLUSTER/pg_xlog
chmod 700 $DEST_CLUSTER/pg_xlog
rm $SOURCE_CLUSTER/recovery.done
#rm $DEST_CLUSTER/pg_hba.conf
cat > $DEST_CLUSTER/recovery.conf <<EOF
standby_mode          = 'on'
primary_conninfo      = 'port=$PORT user=postgres'
trigger_file = '/var/log/pgpool/trigger/trigger_file1'
EOF

psql -p $PORT -c "SELECT pg_stop_backup()" postgres

Please tell me what I am doing wrong.

Thanks

Saurabh Gupta


pgsql-general by date

Next:From: hubert depesz lubaczewskiDate: 2012-02-02 11:24:00
Subject: Re: pg_dump -s dumps data?!
Previous:From: Dean RasheedDate: 2012-02-02 09:32:22
Subject: Re: Audtiting, DDL and DML in same SQL Function

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