Re: streaming replication: one problem & several questions

From: rockwell <i_j_e_x_a(at)yahoo(dot)co(dot)jp>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: streaming replication: one problem & several questions
Date: 2011-08-14 19:57:10
Message-ID: 1313351830220-4698911.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi.

I've experienced very similar behavior and log message. I do not know what
is the problem in detail but my guess is that standby system has data which
is incompatible to accept streaming replication of the master.

The way I solved is the following on Ubuntu11.04. Suppose postgresql.conf
and recover.conf (on standby) are ready.

0. Stop postgresql on standby
standby# /etc/init.d/postgresql stop

1. invoke pg_start_backup() on master
master# sudo -u postgres psql -c "SELECT pg_start_backup('2011-08-15_04:49)"

2. remove data files on standby
standby# cd /var/lib/postgresql/9.0/main
standby# /bin/rm -rf base pg_*
standby# mkdir pg_xlog; chown postgres.postgres pg_xlog; chmod 700 pg_xlog

3. copy data files
master# rsync -av --delete /var/lib/postgresql/9.0/main --exclude=pg_xlog
--exclude=postmaster.pid --exclude=server.crt --exclude=server.key
/path/to/standby/data/directory

4. invoke pg_stop_backup() on master
master# sudo -u postgres psql -c "SELECT pg_stop_backup()"

5. start postgresql on standby
standby# /etc/init.d/postgresql start

Then, I found streaming replication just started to work.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/streaming-replication-one-problem-several-questions-tp4687602p4698911.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ondrej Ivanič 2011-08-15 00:19:10 Re: Where to start, graphs and routing.
Previous Message c k 2011-08-14 17:58:55 Re: Using Postgresql as application server