Re: setting up postgres replication FATAL: database system identifier differs between the primary and standby

From: Ian Lawrence Barwick <barwick(at)gmail(dot)com>
To: Noah <noah-list(at)enabled(dot)com>
Cc: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: setting up postgres replication FATAL: database system identifier differs between the primary and standby
Date: 2022-02-13 00:35:38
Message-ID: CAB8KJ=ixY6H1TDuWKSvcCdE9uU-jT7E4-aWD7ZKXtVDKLRT3jg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

2022年2月13日(日) 8:37 Noah <noah-list(at)enabled(dot)com>:
>
> Ahoy there,
>
> I am attempting to set up postgres12 with replication between two servers.
>
> I followed these instructions.
>
> https://www.digitalocean.com/community/tutorials/how-to-set-up-physical-streaming-replication-with-postgresql-12-on-ubuntu-20-04
>
> At step 4 - I restarted the replica database with command "sudo
> systemctl restart postgresql(at)12-main"
>
> I see these messages in the /var/log/postgresql/postgresql-12-main.log file
>
> --- snip ---
>
> 2022-02-12 17:39:51.345 UTC [237364] LOG: entering standby mode
> 2022-02-12 17:39:51.356 UTC [237365] FATAL: database system identifier
> differs between the primary and standby
> 2022-02-12 17:39:51.356 UTC [237365] DETAIL: The primary's identifier
> is 7048326921585830819, the standby's identifier is 7063458841707763655.
> 2022-02-12 17:39:51.367 UTC [237369] FATAL: database system identifier
> differs between the primary and standby
> 2022-02-12 17:39:51.367 UTC [237369] DETAIL: The primary's identifier
> is 7048326921585830819, the standby's identifier is 7063458841707763655.
> 2022-02-12 17:39:56.380 UTC [237371] FATAL: database system identifier
> differs between the primary and standby
> 2022-02-12 17:39:56.380 UTC [237371] DETAIL: The primary's identifier
> is 7048326921585830819, the standby's identifier is 7063458841707763655.
>
> --- snip ---
>
>
> Is there an easy way to solve this problem?

You appear to be starting a database which is not a copy of the primary node it
is trying to connect to. It's impossible to tell from the provided information
how that happened. Possibly you have more than one instance on the standby
(replica) and are somehow starting the wrong one. If not you'll need to make
a backup of the primary and make sure that's what is being started.

Regards

Ian Barwick

--
EnterpriseDB: https://www.enterprisedb.com

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Ron 2022-02-13 01:03:45 Re: setting up postgres replication FATAL: database system identifier differs between the primary and standby
Previous Message Noah 2022-02-12 23:37:12 setting up postgres replication FATAL: database system identifier differs between the primary and standby