On Tue, Sep 22, 2020 at 7:52 PM Julien Rouhaud <rjuju123@gmail.com> wrote: > > On Tue, Sep 22, 2020 at 7:36 PM İsmet BALAT <bcalbatros@gmail.com> wrote: > > > > Hi Julien, > > > > Thanks for the reply. My log in addition. I did; > > 1- rm -fr /var/lib/pgsql/12/data/* > > 2- /usr/pgsql-12/bin/pg_basebackup --host=master_ip --pgdata=/var/lib/pgsql/12/data/ --username=replica_user --verbose --progress --wal-method=stream --write-recovery-conf --checkpoint=fast --create-slot --slot=ha_slot > > 3- systemctl restart postgresql-12 > > 4- Crush :/ > > > > But I tried same steps and all of this and avarage 8-success, 2-this fail. I don't understand because I did same everthing of steps. > > > > Thank you for now. > > It seems that you have an issue with your procedure, as the logs show: > > 2020-09-22 14:23:59.041 +03 [5045] FATAL: database system identifier > differs between the primary and standby > 2020-09-22 14:23:59.041 +03 [5045] DETAIL: The primary's identifier > is 6875268062102845505, the standby's identifier is > 6875268050644555587. > [...] > 2020-09-22 14:30:27.418 +03 [9247] LOG: database system was shut down > in recovery at 2020-09-22 14:30:27 +03 > 2020-09-22 14:30:27.419 +03 [9247] LOG: entering standby mode > 2020-09-22 14:30:27.419 +03 [9247] LOG: invalid primary checkpoint record > 2020-09-22 14:30:27.419 +03 [9247] PANIC: could not locate a valid > checkpoint record > 2020-09-22 14:30:28.913 +03 [9244] LOG: startup process (PID 9247) > was terminated by signal 6: Aborted > 2020-09-22 14:30:28.913 +03 [9244] LOG: aborting startup due to > startup process failure > 2020-09-22 14:30:29.008 +03 [9244] LOG: database system is shut down > > I see that your step 3 is to *restart* the postgres service. Are you > executing the pg_basebackup command (and removing the data) while the > server is running? If yes don't search any further, that can't work.
For the archive's sake, OP did confirm that stopping postgres before step 1 fixed the issue.