Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gUBHQ-00081c-S0 for pgsql-admin@arkaria.postgresql.org; Tue, 04 Dec 2018 14:02:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gUBGQ-0004a0-5Q for pgsql-admin@arkaria.postgresql.org; Tue, 04 Dec 2018 14:01:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gUBGP-0004Zs-Tu for pgsql-admin@lists.postgresql.org; Tue, 04 Dec 2018 14:01:25 +0000 Received: from tamriel.snowman.net ([2001:470:e38f::11]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gUBGL-0002VB-Vv for pgsql-admin@postgresql.org; Tue, 04 Dec 2018 14:01:24 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 23BBC5F7A6; Tue, 4 Dec 2018 09:01:20 -0500 (EST) Date: Tue, 4 Dec 2018 09:01:20 -0500 From: Stephen Frost To: AYahorau@ibagroup.eu Cc: pgsql-admin@postgresql.org, MikalaiKeida@ibagroup.eu Subject: Re: pg_basebackup fails: could not receive data from WAL stream: server closed the connection unexpectedly Message-ID: <20181204140119.GN3415@tamriel.snowman.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="f1mdG47JcDrWf2Io" 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 --f1mdG47JcDrWf2Io Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * AYahorau@ibagroup.eu (AYahorau@ibagroup.eu) wrote: > Not so long ago I faced the problem of database synchronization using=20 > pg_basebackup utility on linux SLES 12 machine using PostgreSQL 10.4: >=20 > pg_basebackup -h host01 -U dbuser -D /var/PostgresDb -w > LOG: standby "pg_basebackup" is now a synchronous standby with priority 1 > pg_basebackup: could not receive data from WAL stream: server closed the= =20 > connection unexpectedly > This probably means the server terminated abnormally > before or while processing the request. > pg_basebackup: child process exited with error 1 > pg_basebackup: removing contents of data directory "/var/RtpPostgresDb" >=20 >=20 > PostgreSQL log of master server contain the following error entry: > terminating walsender process due to replication timeout >=20 > Currently my configuration is the following: > wal_sender_timeout =3D 1s > wal_receiver_timeout =3D 1s > wal_receiver_status_interval =3D 10s pg_basebackup has a status-interval option (called statusint in older versions). Have you tried setting that option...? Also, seems like you'd really need to also be running pg_receivewal... At some point the pg_basebackup will end and disconnect. Or you could run a replica instead of using pg_basebackup/pg_receivewal and then take regular backups and archive your WAL with something like pgbackrest. Thanks! Stephen --f1mdG47JcDrWf2Io Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJcBoivAAoJEO1sijiDR2RVpE8P/0lQdeY+AuZ/XEGoq49pF+Mc 5PASGmzdVsca+2np6GUTnGutk+LhPdGZbnTCQ4IqCI5y9WH9Qk190JYsKY836Mtr uRYiYsH/2wOAnklInvRFrIpQ7/Y0gx4LPhEL/OeZ75js39oudWnxuWjqudY6gNjf vSqqiB9JV5DPx8O5YIYNGh/EJY7BWz9xBtuI1CssDjsdVTFlR7nAvnz1bYqo6rfm O6/PW1MRzZ382ABO8nhLkMqMUohqSmKHMS43nitS7f4XzUQYyl+itD1KEhFtWpNJ tfqDUf+DzLkSeJ9meP8XLqltbM0sOrc3RAQBN1RHCZxs0auXVYd4fXlJQvAFbVSm kUdFEXOX37JnMOhmDZyYfoyChygD2nMW7qg0/Fkr9XblHgsbVAE5bK8+lUKERDjj /dK8utWPqkEEgzwtBCJvzAPm4N03TGopsgF3GQQG1pkueLs3XJXBDiq8dbBH8Loc +rO5KPiszk0se73H42hK+bOHQzxkAEgB6XWdzt3W3QPY4EA4HpXYFnGqTo67XCgM hc00ca7T3WDv3QT+0x2vlP7clAEsNB8C/r5znbeXfjV/Risr9OyUSFKhvCMMXbr/ momIb3oRseeudnMqOavGM5J1F/97CdPeYz5gAXysiW7GGHp1RhkpiYNMqE4ZZ4BA F/26lk/zy9ObUk/+sP1b =AHnr -----END PGP SIGNATURE----- --f1mdG47JcDrWf2Io--