Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jqzzI-0003d6-AR for pgsql-admin@arkaria.postgresql.org; Thu, 02 Jul 2020 14:14:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jqzzG-0004OS-7J for pgsql-admin@arkaria.postgresql.org; Thu, 02 Jul 2020 14:14:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jqzzF-0004Nv-Uz for pgsql-admin@lists.postgresql.org; Thu, 02 Jul 2020 14:14:49 +0000 Received: from tamriel.snowman.net ([2001:470:e38f::11]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jqzzB-0002M7-9p for pgsql-admin@postgresql.org; Thu, 02 Jul 2020 14:14:47 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id B32DF5F79F; Thu, 2 Jul 2020 10:14:44 -0400 (EDT) Date: Thu, 2 Jul 2020 10:14:44 -0400 From: Stephen Frost To: Praveen Kumar K S Cc: pgsql-admin@postgresql.org Subject: Re: [HELP] Issue with standby server using WAL archive Message-ID: <20200702141444.GJ3125@tamriel.snowman.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="viPXr9xSpacAnv0s" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --viPXr9xSpacAnv0s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Praveen Kumar K S (praveenssit@gmail.com) wrote: > Config on Master: > archive_mode =3D on > archive_command =3D '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 =3D 'on' > restore_command =3D 'cp /mnt/server/archivedir/%f %p' >=20 > Before starting standby, I took base backup >=20 > 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 >=20 > NOTICE: pg_stop_backup complete, all required WAL segments have been > archived > pg_basebackup: base backup completed >=20 > Now, copied recovery.conf to data directory >=20 > Started postgres server on standby and seeing below error in log. >=20 > 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 --viPXr9xSpacAnv0s Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJe/evUAAoJEO1sijiDR2RVXm8P/A4gxniPd6AJZZIdy2VQsTAr teyNmgMRECGftw8vxeUs2ZjIIb9kN0PH2uMmcQQidatfmAdWNO1JUSfrx+Qjvfy3 NVMvSHFQ5JbPHVTL+FZNEfbot/R4hhLLx9pj54prjrbYKYnUzDoLUM8EkcoTIehu 9nsm/P8LpZZX1XKKVD9yD+X5hJNDuSPCGsBo3bVQJUsirBLMXnZI3ep8wXf8MJJi 9G4GmEI/QB62iCmHHaRCKDK0IREX35Us79dzvZP4EvRQsl9p1+vc3+DFMFO/eLvw heUxraJqNHsF/zdoHE39kdcobU16hZJDcTNPSe32TOWmAheuuyEjNSUi55x4ddCM ZdQEvmQJX3GdE91WjH8Lvgv/OWVPZgF4FVzZvyySKNykkA9Wr73shObSGodVWN8S KzUKqyz/anyQj7g/qSa3Tn0v1aC+JYazPefsdghdaWcQ2RWQoLhmNoj8uMGv+vfe rCwWbuXvH1ViS6TkuC4iBNs0j1pad0r9jbvkIrxulUHgh+3Ju+bnTGTFlxgkg8wF P1UuvMfEslUxX8Nrz8JM7CRcY6CM7sT1eya5J8gf95uJFHNFrrdn7Gy1U3oBKR1X umdcsuKGkSnrlqjWi+IKABMw0fiklxqMHrIFqYPnjYbOPubbKYh2LAFBb5mE/Rn8 9jwuZIufEl+p8N+kDfUi =lRM7 -----END PGP SIGNATURE----- --viPXr9xSpacAnv0s--