Обсуждение: Streaming Replication - Error on Standby

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

Streaming Replication - Error on Standby

От
bobJobS
Дата:
Postgres 9.3.2.
RHEL 5

After performing all of the Streaming Replication setup steps, I get the
following error message in my standby DB log file.

  database system identifier differ between the primary and standby

I've double checked the recovery.conf file and it contains the correct
hostname, port, username and password.

I've also verified that ssh into either the primaryor standby as the
replication user does not require a password.

When building the standby I took the latest backup from the primary and
loaded the standby. After, I executed the start backup command on the
primary, followed by rsync, then the stop backup command.

I've googled the heck out of the error message and I found only references
to invalid primary connection information.

Any ideas?



--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Streaming-Replication-Error-on-Standby-tp5791463.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


Re: Streaming Replication - Error on Standby

От
bricklen
Дата:
On Tue, Feb 11, 2014 at 10:12 AM, bobJobS <russelljanusz@yahoo.com> wrote:
Postgres 9.3.2.
RHEL 5

After performing all of the Streaming Replication setup steps,

What replication steps?
 
  database system identifier differ between the primary and standby

How did you take the initial backup of the master? Did you rsync the master filesystem (after issuing pg_start_backup()) or use pg_basebackup, or did you literally take a pg_dump of the master and try to turn that backup into a slave? If the latter, you will need to use the rsync/pg_basebackup method.

There are some reasonably thorough steps at http://dba.stackexchange.com/a/53546/24393 if you want to compare them against what you tried already.

Re: Streaming Replication - Error on Standby

От
bobJobS
Дата:

To get the standby server to a point, I tool a globals dump and a data dump
of the primary server and build the standby.

Then I executed pg_startbackup, rsync data dir to standby data dir (to catch
any changes made while I was building the standby) and finally
pg_stopbackup... all on the primary.

Thank you for the URL. I'll check it out.



--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Streaming-Replication-Error-on-Standby-tp5791463p5791478.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


Re: Streaming Replication - Error on Standby

От
bricklen
Дата:
On Tue, Feb 11, 2014 at 11:25 AM, bobJobS <russelljanusz@yahoo.com> wrote:

To get the standby server to a point, I tool a globals dump and a data dump
of the primary server and build the standby.

Then I executed pg_startbackup, rsync data dir to standby data dir (to catch
any changes made while I was building the standby) and finally
pg_stopbackup... all on the primary.


The steps you are using will not work. You cannot use a pg_dump/pg_dump backup from a master to set up a slave. pg_dump generates a "logical" backup, which is used for recovery not setting up slaves.  A very high-level view of the replication setup:
- put the master in backup mode
- pg_basebackup of the master to the slave (no slave data exists prior to this step)
- take the master out of backup mode

Re: Streaming Replication - Error on Standby

От
Adrian Klaver
Дата:
On 02/11/2014 10:12 AM, bobJobS wrote:
> Postgres 9.3.2.
> RHEL 5
>
> After performing all of the Streaming Replication setup steps, I get the
> following error message in my standby DB log file.
>
>    database system identifier differ between the primary and standby
>
> I've double checked the recovery.conf file and it contains the correct
> hostname, port, username and password.
>
> I've also verified that ssh into either the primaryor standby as the
> replication user does not require a password.
>
> When building the standby I took the latest backup from the primary and
> loaded the standby. After, I executed the start backup command on the
> primary, followed by rsync, then the stop backup command.
>
> I've googled the heck out of the error message and I found only references
> to invalid primary connection information.
>
> Any ideas?

Look at this tutorial:

https://wiki.postgresql.org/wiki/Binary_Replication_Tutorial



--
Adrian Klaver
adrian.klaver@gmail.com


Re: Streaming Replication - Error on Standby

От
Adrian Klaver
Дата:
On 02/11/2014 10:12 AM, bobJobS wrote:
> Postgres 9.3.2.
> RHEL 5
>
> After performing all of the Streaming Replication setup steps, I get the
> following error message in my standby DB log file.
>
>    database system identifier differ between the primary and standby
>
> I've double checked the recovery.conf file and it contains the correct
> hostname, port, username and password.
>
> I've also verified that ssh into either the primaryor standby as the
> replication user does not require a password.
>
> When building the standby I took the latest backup from the primary and
> loaded the standby. After, I executed the start backup command on the
> primary, followed by rsync, then the stop backup command.
>
> I've googled the heck out of the error message and I found only references
> to invalid primary connection information.
>
> Any ideas?
>


Also meant to send this link which is newer and covers pg_basebackup:

https://wiki.postgresql.org/wiki/Hot_Standby



--
Adrian Klaver
adrian.klaver@gmail.com


Re: Streaming Replication - Error on Standby

От
bobJobS
Дата:
Thanks for the information and the URLs!



--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Streaming-Replication-Error-on-Standby-tp5791463p5791588.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.