Обсуждение: Setting up replication

Поиск
Список
Период
Сортировка

Setting up replication

От
Robert Fitzpatrick
Дата:
I have a question about setting up replication between my
postgresql-9.3.6 servers. If I'm using pg_basebackup on my FreeBSD 10.1
slave server, the postgresql.conf file is in the data directory, which
pg_basebackup insists must be empty. I can't find any info about how to
relocate the postgresql.conf file and tell the init script its new
location. If I setup PITR prior to replication setup and share the same
postgresql.conf file transferred by pg_basebackup, how can both servers
see the archive directory? It is local for the slave, nfs mount for the
master.

Obviously there is something I'm missing or not understanding, can
anyone help? Thanks!

--
Robert



Re: Setting up replication

От
Adrian Klaver
Дата:
On 03/17/2015 04:08 PM, Robert Fitzpatrick wrote:
> I have a question about setting up replication between my
> postgresql-9.3.6 servers. If I'm using pg_basebackup on my FreeBSD 10.1
> slave server, the postgresql.conf file is in the data directory, which
> pg_basebackup insists must be empty. I can't find any info about how to
> relocate the postgresql.conf file and tell the init script its new
> location. If I setup PITR prior to replication setup and share the same
> postgresql.conf file transferred by pg_basebackup, how can both servers
> see the archive directory? It is local for the slave, nfs mount for the
> master.
>
> Obviously there is something I'm missing or not understanding, can
> anyone help? Thanks!

A step by step on what you are doing would help.

In the meantime:

1) You should not have to initdb the standby, that is handled by
pg_basebackup copying over the binary files.

2) The archive directory in the standby is pointed to in recovery.conf:
http://www.postgresql.org/docs/9.3/static/recovery-config.html

A simple one can be set by pg_basebackup:

http://www.postgresql.org/docs/9.3/interactive/app-pgbasebackup.html

-R
--write-recovery-conf

     Write a minimal recovery.conf in the output directory (or into the
base archive file when using tar format) to ease setting up a standby
server.

>


--
Adrian Klaver
adrian.klaver@aklaver.com