Re: streaming replication: one problem & several questions

Поиск
Список
Период
Сортировка
От rockwell
Тема Re: streaming replication: one problem & several questions
Дата
Msg-id 1313351830220-4698911.post@n5.nabble.com
обсуждение исходный текст
Ответ на streaming replication: one problem & several questions  (Lonni J Friedman <netllama@gmail.com>)
Список 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.

В списке pgsql-general по дате отправления:

Предыдущее
От: c k
Дата:
Сообщение: Re: [ADMIN] Using Postgresql as application server
Следующее
От: Ondrej Ivanič
Дата:
Сообщение: Re: Where to start, graphs and routing.