Re: 9.1.3: launching streaming replication

Поиск
Список
Период
Сортировка
От Michael Nolan
Тема Re: 9.1.3: launching streaming replication
Дата
Msg-id CAOzAquLWfnmuGSzZBHUaeCBAev2cubC8gEQ7A544s1ei-6Huhg@mail.gmail.com
обсуждение исходный текст
Ответ на 9.1.3: launching streaming replication  ("Welty, Richard" <rwelty@ltionline.com>)
Ответы Re: 9.1.3: launching streaming replication
Список pgsql-general


On Mon, Apr 2, 2012 at 4:21 PM, Welty, Richard <rwelty@ltionline.com> wrote:

I got similar messages the first few times I tried to start up my slave server, I never did figure out exactly what caused it.

You can either delete all the files on the slave and try again, or do what I did, write a script that handles transferring just the files needed to resync the slave.

Here's the script I've been using to transfer the files between my two servers to resync them. This is not a production-ready script.

I have a second tablespace, so there are two 'data' transfers plus the xlog transfer.  (You may run into issues transferring the pg_tblspc directory, as I did, hence the '-safe-links' parameter.) The '-delete' term deletes any files on the slave that aren't on the server, unless you list them in an '--exclude' clause.)

/usr/local/pgsql/bin/psql -c "select pg_start_backup('tardir',true)" postgres postgres

rsync -av --exclude log.out --exclude postgresql.conf \
--exclude postgresql.pid --delete --exclude pg_hba.conf \
--exclude pg_xlog --exclude server.crt --exclude server.key \
--exclude restore.conf --exclude restore.done \
--safe-links /usr/local/pgsql/data/ postgres@xxx:/usr/local/pgsql/data

rsync -av /usr/local/pgsql/data2/ postgres@xxx:/usr/local/pgsql/data2

/usr/local/pgsql/bin/psql -c "select pg_stop_backup()" postgres postgres

rsync -av /usr/local/pgsql/data/pg_xlog postgres@xxx:/usr/local/pgsql/data/

echo "ok to start standby"

--
Mike Nolan


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

Предыдущее
От: Efraín Déctor
Дата:
Сообщение: Re: Where to create an Index
Следующее
От: Michael Nolan
Дата:
Сообщение: Re: 9.1.3: launching streaming replication