Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5mHG-00043n-HG for pgsql-general@arkaria.postgresql.org; Fri, 28 Sep 2018 06:29:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g5mHE-00083h-QB for pgsql-general@arkaria.postgresql.org; Fri, 28 Sep 2018 06:29:24 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5mHE-00083a-Er for pgsql-general@lists.postgresql.org; Fri, 28 Sep 2018 06:29:24 +0000 Received: from hermes.gatewaynet.com ([193.92.121.98]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g5mHA-0005gH-EQ for pgsql-general@lists.postgresql.org; Fri, 28 Sep 2018 06:29:23 +0000 Received: from smadev.internal.net (pc131.internal.net [10.9.200.131]) by hermes.gatewaynet.com (8.14.3/8.14.3/Debian-9.4) with ESMTP id w8S6TAXL000688 for ; Fri, 28 Sep 2018 09:29:15 +0300 Received: from smadev.internal.net (smadev [10.9.200.131]) by smadev.internal.net (8.15.2/8.15.2) with ESMTP id w8S6TAwn000795 for ; Fri, 28 Sep 2018 09:29:10 +0300 (EEST) (envelope-from achill@matrix.gatewaynet.com) Subject: Re: Replication Issues To: pgsql-general@lists.postgresql.org References: From: Achilleas Mantzios Message-ID: Date: Fri, 28 Sep 2018 09:29:10 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.0.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------8896CB8F0203E0B2E6045342" Content-Language: en-US X-Virus-Scanned: clamav-milter 0.98.7 at hermes X-Virus-Status: Clean X-Spam-Status: No, score=-28.0 required=5.0 tests=ALL_TRUSTED,DYN_HAM_COORD, DYN_HAM_IT,DYN_HAM_NAUTICAL,HTML_MESSAGE autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on hermes.gatewaynet.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------8896CB8F0203E0B2E6045342 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 28/9/18 9:00 π.μ., bhargav kamineni wrote: > Hi Team, > > I have configured replication using slot ,But it failed by throwing the ERROR /pg_basebackup: could not get transaction log end position from server: ERROR:  requested WAL segment > 0000000100002C9D00000085 has already been removed /, which is  unexpected because i have created the slot on master first and then issued the base backup command from slave's end > the command is > /usr/lib/postgresql/9.5/bin/pg_basebackup -U  user --max-rate='150 M' --progress --verbose --write-recovery-conf --status-interval='10 s' -D data_dir  -h host_ip  -p 5433/ Either : add  "-X stream" to the pg_basebackup command or increase wal_keep_segments on the server. > These are the settings on my master > archive_mode=on > archive_command='/bin/true' > wal_keep_segments=512 > max_wal_senders=4 > Series of steps i have followed : > 1) Enabled password less authentication between master and slave > 2)created slot on master (assuming it will store wal's regardless of other settings) > 3)started basebackup from slave's end > 4)Issued checkpoint at master's end > > Here my concern is , slave should recover WAL from replication slot but why i got the above ERROR , Why slot removed  the requested wal file , Could you please let me know the reason why it happened > or did i miss something ? > > Thanks, > Bhargav K > -- Achilleas Mantzios IT DEV Lead IT DEPT Dynacom Tankers Mgmt --------------8896CB8F0203E0B2E6045342 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
On 28/9/18 9:00 π.μ., bhargav kamineni wrote:
Hi Team,

I have configured replication using slot ,But it failed by throwing the ERROR  pg_basebackup: could not get transaction log end position from server: ERROR:  requested WAL segment 0000000100002C9D00000085 has already been removed , which is  unexpected because i have created the slot on master first and then issued the base backup command from slave's end 
the command is 
usr/lib/postgresql/9.5/bin/pg_basebackup -U  user --max-rate='150 M' --progress --verbose --write-recovery-conf --status-interval='10 s' -D data_dir  -h host_ip  -p 5433

Either :
add  "-X stream" to the pg_basebackup command
or
increase wal_keep_segments on the server.

These  are the settings on my master 
archive_mode=on
archive_command='/bin/true'
wal_keep_segments=512
max_wal_senders=4
Series of steps i have followed :
1) Enabled password less authentication between master and slave 
2)created slot on master (assuming it will store wal's regardless of other settings)
3)started basebackup from slave's end
4)Issued checkpoint at master's end

Here my concern is , slave should recover WAL from replication slot but why i got the above ERROR , Why slot removed  the requested wal file , Could you please let me know the reason why it happened or did i miss something ?

Thanks,
Bhargav K



-- 
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt
--------------8896CB8F0203E0B2E6045342--