pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: Praveen Kumar K S <praveenssit@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: [HELP] Issue with standby server using WAL archive
Date: Thu, 2 Jul 2020 10:14:44 -0400
Message-ID: <20200702141444.GJ3125@tamriel.snowman.net> (raw)
In-Reply-To: <CANSiNp6iAACN_4HjHUqFEmTOd_0QvdBiE5W1XXjwFniNwUWAYQ@mail.gmail.com>
References: <CANSiNp6iAACN_4HjHUqFEmTOd_0QvdBiE5W1XXjwFniNwUWAYQ@mail.gmail.com>

Greetings,

* Praveen Kumar K S (praveenssit@gmail.com) wrote:
> Config on Master:
> archive_mode = on
> archive_command = 'test ! -f /mnt/server/archivedir/%f && cp %p
> /mnt/server/archivedir/%f'

You really shouldn't use 'cp' or such a simple archive command, you'll
very likely lose WAL on a system crash with that setup.

> Config on standby:
> standby_mode = 'on'
> restore_command = 'cp /mnt/server/archivedir/%f %p'
> 
> Before starting standby, I took base backup
> 
> pg_basebackup -v -D main -R -P -h pg1 -p 5432 -U replication
> pg_basebackup: initiating base backup, waiting for checkpoint to complete
> pg_basebackup: checkpoint completed
> 43518/43518 kB (100%), 1/1 tablespace
> 
> NOTICE:  pg_stop_backup complete, all required WAL segments have been
> archived
> pg_basebackup: base backup completed
> 
> Now, copied recovery.conf to data directory
> 
> Started postgres server on standby and seeing below error in log.
> 
> 2020-07-02 13:14:02.134 UTC [7643] postgres@template1 FATAL:  the database
> system is starting up
> 2020-07-02 13:14:02.644 UTC [7646] postgres@template1 FATAL:  the database
> system is starting up
> 2020-07-02 13:14:03.154 UTC [7649] postgres@template1 FATAL:  the database
> system is starting up
> 2020-07-02 13:14:03.664 UTC [7652] postgres@template1 FATAL:  the database
> system is starting up
> 2020-07-02 13:14:04.174 UTC [7655] postgres@template1 FATAL:  the database
> system is starting up
> cp: cannot stat '/mnt/server/archivedir/00000001000000000000000D': No such
> file or directory
> 2020-07-02 13:14:04.684 UTC [7660] postgres@template1 FATAL:  the database
> system is starting up
> 2020-07-02 13:14:05.194 UTC [7663] postgres@template1 FATAL:  the database
> system is starting up
> 2020-07-02 13:14:05.197 UTC [7664] [unknown]@[unknown] LOG:  incomplete
> startup packet
> cp: cannot stat '/mnt/server/archivedir/00000001000000000000000D': No such
> file or directory
> cp: cannot stat '/mnt/server/archivedir/00000001000000000000000D': No such
> file or directory

> Am I missing anything here ? Please suggest. TIA.

Do you have hot_standby enabled in postgresql.conf?  What version of PG?

Thanks,

Stephen

Attachments:

  signature.asc (application/pgp-signature, 818B) download

view thread (11+ messages)  latest in thread

Message-ID: <20200702141444.GJ3125@tamriel.snowman.net>
Permalink:  ../20200702141444.GJ3125@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20200702141444.GJ3125@tamriel.snowman.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: sfrost@snowman.net, praveenssit@gmail.com
  Subject: Re: [HELP] Issue with standby server using WAL archive
  In-Reply-To: <20200702141444.GJ3125@tamriel.snowman.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox