Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Z57eS-0002f0-2C for pgsql-general@arkaria.postgresql.org; Wed, 17 Jun 2015 07:20:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Z57eR-0001LQ-HS for pgsql-general@arkaria.postgresql.org; Wed, 17 Jun 2015 07:20:47 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Z57eP-0001Ib-7M for pgsql-general@postgresql.org; Wed, 17 Jun 2015 07:20:45 +0000 Received: from mail-wi0-x232.google.com ([2a00:1450:400c:c05::232]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Z57eM-0001QR-Eb for pgsql-general@postgresql.org; Wed, 17 Jun 2015 07:20:43 +0000 Received: by wiga1 with SMTP id a1so129651602wig.0 for ; Wed, 17 Jun 2015 00:20:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type; bh=dpefcu7yrpGKqivMCN0W9MKdgSiJO9hpGWnsAn4UkuI=; b=idSYk9s083L9kGyxenn2GhZTC5SazU4DJCctYxQBAsXym6qMb3oGnq2vec3BduyTyH S5UmD7smsXsKbVDOZQ8//s02zdP4dOXbpnNJAbTSJ+5sQLFtULsM2Rq419wo2SsegrOW L0RclLeclT0HEC99EK7gHbboiCMbJxjuof1YsAzOE5R8bYurrRpHTuJ2fgy76WxuSkoF E7YxrRNrfyzMagkg/DDG1lY32WMHKHfyt2LSDgCbqjv08pbbDR6Y1Z/xJAngqxurmAVo Bk5BLT5gmFdWTxbcbOp+SOAZUxKp9YKpsfFgxFL6LGURCU1PPUSjcHov0oaahdxShk3Z 5b3Q== X-Received: by 10.180.81.194 with SMTP id c2mr14647070wiy.94.1434525640723; Wed, 17 Jun 2015 00:20:40 -0700 (PDT) Received: from [10.3.255.188] (pir44-4-88-177-221-225.fbx.proxad.net. [88.177.221.225]) by mx.google.com with ESMTPSA id y19sm6136978wia.15.2015.06.17.00.20.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jun 2015 00:20:40 -0700 (PDT) Subject: Re: pg_xlog on a hot_stanby slave To: Guillaume Lelarge References: Cc: PostgreSQL General From: Xavier 12 Message-ID: <55811FC5.60806@gmail.com> Date: Wed, 17 Jun 2015 09:20:37 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------060409030401080201070000" X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org This is a multi-part message in MIME format. --------------060409030401080201070000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 16/06/2015 22:28, Guillaume Lelarge wrote: > 2015-06-16 15:55 GMT+02:00 Xavier 12 >: > > I don't think so. There is no archive_command and the master doesn't > ship its wal here. > But how can I check that ? > > > What's the complete path to the directory on the salve that contains > 951 files? what does PostgreSQL say on its log files? in /var/lib/postgresql/9.1/main/pg_xlog/ 1059 files today. Too much to copy/paste here. Here are the first ones : -rw------- 1 postgres postgres 16777216 Jun 9 08:40 000000040000040B0000007E -rw------- 1 postgres postgres 16777216 Jun 9 08:41 000000040000040B0000007F -rw------- 1 postgres postgres 16777216 Jun 9 08:42 000000040000040B00000080 -rw------- 1 postgres postgres 16777216 Jun 9 08:44 000000040000040B00000081 There are no .done or .ready and archive_status is empty. Nothing critical in the logs : Jun 17 08:55:11 psql02 postgres[4231]: [2-1] 2015-06-17 08:55:11 CEST LOG: paquet de d?marrage incomplet Jun 17 08:55:41 psql02 postgres[4322]: [2-1] 2015-06-17 08:55:41 CEST LOG: paquet de d?marrage incomplet Jun 17 08:56:11 psql02 postgres[4356]: [2-1] 2015-06-17 08:56:11 CEST LOG: paquet de d?marrage incomplet Jun 17 08:56:41 psql02postgres[4460]: [2-1] 2015-06-17 08:56:41 CEST LOG: paquet de d?marrage incomplet Jun 17 08:56:55 psql02postgres[4514]: [2-1] 2015-06-17 08:56:55 CEST ERREUR: restauration en cours Jun 17 08:56:55 psql02postgres[4514]: [2-2] 2015-06-17 08:56:55 CEST ASTUCE : les fonctions de contr?le des journaux de transactions ne peuvent pas Jun 17 08:56:55 psql02postgres[4514]: [2-3] #011?tre ex?cut?es lors de la restauration. Jun 17 08:56:55 psql02postgres[4514]: [2-4] 2015-06-17 08:56:55 CEST INSTRUCTION : select pg_current_xlog_location() pg_current_xlog_location() is for a zabbix check, "ERREUR" is because that server is readyonly. Xavier C. > > 2015-06-16 12:41 GMT+02:00 Guillaume Lelarge > >: > > Le 16 juin 2015 10:57 AM, "Xavier 12" > a écrit : > >> > >> Hi everyone, > >> > >> Questions about pg_xlogs again... > >> I have two Postgresql 9.1 servers in a master/slave stream > replication > >> (hot_standby). > >> > >> Psql01 (master) is backuped with Barman and pg_xlogs is correctly > >> purged (archive_command is used). > >> > >> Hower, Psql02 (slave) has a huge pg_xlog (951 files, 15G for 7 days > >> only, it keeps growing up until disk space is full). I have found > >> documentation and tutorials, mailing list, but I don't know what is > >> suitable for a Slave. Leads I've found : > >> > >> - checkpoints > >> - archive_command > >> - archive_cleanup > >> > >> Master postgresq.conf : > >> > >> [...] > >> wal_level = 'hot_standby' > >> archive_mode = on > >> archive_command = 'rsync -az > /var/lib/postgresql/9.1/main/pg_xlog/%f > >> barman@nas.lan:/data/pgbarman/psql01/incoming/%f' > >> max_wal_senders = 5 > >> wal_keep_segments = 64 > >> autovacuum = on > >> > >> Slave postgresql.conf : > >> > >> [...] > >> wal_level = minimal > >> wal_keep_segments = 32 > >> hot_standby = on > >> > >> Slave recovery.conf : > >> > >> standby_mode = 'on' > >> primary_conninfo = 'host=10.0.0.1 port=5400 user=postgres' > >> trigger_file = '/var/lib/postgresql/9.1/triggersql' > >> restore_command='cp /var/lib/postgresql/9.1/wal_archive/%f "%p"' > >> archive_cleanup_command = > >> '/usr/lib/postgresql/9.1/bin/pg_archivecleanup > >> /var/lib/postgresql/9.1/wal_archive/ %r' > >> > >> > >> > >> > >> > >> How can I reduce the number of WAL files on the hot_stanby slave ? > >> > > > > Depends on what you're talking about. If they are archived wal, > > pg_archive_cleanup is what you're looking for. > > > > > -- > Guillaume. > http://blog.guillaume.lelarge.info > http://www.dalibo.com --------------060409030401080201070000 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

On 16/06/2015 22:28, Guillaume Lelarge wrote:
2015-06-16 15:55 GMT+02:00 Xavier 12 <maniatux@gmail.com>:
I don't think so. There is no archive_command and the master doesn't
ship its wal here.
But how can I check that ?


What's the complete path to the directory on the salve that contains 951 files? what does PostgreSQL say on its log files?

in /var/lib/postgresql/9.1/main/pg_xlog/

1059 files today.
Too much to copy/paste here.
Here are the first ones :

-rw------- 1 postgres postgres 16777216 Jun  9 08:40 000000040000040B0000007E
-rw------- 1 postgres postgres 16777216 Jun  9 08:41 000000040000040B0000007F
-rw------- 1 postgres postgres 16777216 Jun  9 08:42 000000040000040B00000080
-rw------- 1 postgres postgres 16777216 Jun  9 08:44 000000040000040B00000081

There are no .done or .ready and archive_status is empty.

Nothing critical in the logs :

Jun 17 08:55:11 psql02 postgres[4231]: [2-1] 2015-06-17 08:55:11 CEST LOG:  paquet de d?marrage incomplet
Jun 17 08:55:41 psql02 postgres[4322]: [2-1] 2015-06-17 08:55:41 CEST LOG:  paquet de d?marrage incomplet
Jun 17 08:56:11 psql02 postgres[4356]: [2-1] 2015-06-17 08:56:11 CEST LOG:  paquet de d?marrage incomplet
Jun 17 08:56:41 psql02postgres[4460]: [2-1] 2015-06-17 08:56:41 CEST LOG:  paquet de d?marrage incomplet
Jun 17 08:56:55 psql02postgres[4514]: [2-1] 2015-06-17 08:56:55 CEST ERREUR:  restauration en cours
Jun 17 08:56:55 psql02postgres[4514]: [2-2] 2015-06-17 08:56:55 CEST ASTUCE :  les fonctions de contr?le des journaux de transactions ne peuvent pas
Jun 17 08:56:55 psql02postgres[4514]: [2-3] #011?tre ex?cut?es lors de la restauration.
Jun 17 08:56:55 psql02postgres[4514]: [2-4] 2015-06-17 08:56:55 CEST INSTRUCTION :  select pg_current_xlog_location()

pg_current_xlog_location() is for a zabbix check, "ERREUR" is because that server is readyonly.

Xavier C.



2015-06-16 12:41 GMT+02:00 Guillaume Lelarge <guillaume@lelarge.info>:
> Le 16 juin 2015 10:57 AM, "Xavier 12" <maniatux@gmail.com> a écrit :
>>
>> Hi everyone,
>>
>> Questions about pg_xlogs again...
>> I have two Postgresql 9.1 servers in a master/slave stream replication
>> (hot_standby).
>>
>> Psql01 (master) is backuped with Barman and pg_xlogs is correctly
>> purged (archive_command is used).
>>
>> Hower, Psql02 (slave) has a huge pg_xlog (951 files, 15G for 7 days
>> only, it keeps growing up until disk space is full). I have found
>> documentation and tutorials, mailing list, but I don't know what is
>> suitable for a Slave. Leads I've found :
>>
>> - checkpoints
>> - archive_command
>> - archive_cleanup
>>
>> Master postgresq.conf :
>>
>> [...]
>> wal_level = 'hot_standby'
>> archive_mode = on
>> archive_command = 'rsync -az /var/lib/postgresql/9.1/main/pg_xlog/%f
>> barman@nas.lan:/data/pgbarman/psql01/incoming/%f'
>> max_wal_senders = 5
>> wal_keep_segments = 64
>> autovacuum = on
>>
>> Slave postgresql.conf :
>>
>> [...]
>> wal_level = minimal
>> wal_keep_segments = 32
>> hot_standby = on
>>
>> Slave recovery.conf :
>>
>> standby_mode = 'on'
>> primary_conninfo = 'host=10.0.0.1 port=5400 user=postgres'
>> trigger_file = '/var/lib/postgresql/9.1/triggersql'
>> restore_command='cp /var/lib/postgresql/9.1/wal_archive/%f "%p"'
>> archive_cleanup_command =
>> '/usr/lib/postgresql/9.1/bin/pg_archivecleanup
>> /var/lib/postgresql/9.1/wal_archive/ %r'
>>
>>
>>
>>
>>
>> How can I reduce the number of WAL files on the hot_stanby slave ?
>>
>
> Depends on what you're talking about. If they are archived wal,
> pg_archive_cleanup is what you're looking for.



--

--------------060409030401080201070000--