From: Niels Kristian Schjødt <nielskristian@autouncle.com>
To: Magnus Hagander <magnus@hagander.net>
Cc: postgres performance list <pgsql-performance@postgresql.org>
Subject: Re: Why is my pg_xlog directory so huge?
Date: Mon, 18 Mar 2013 16:41:19 +0100
Message-ID: <1018C01B-F44B-4E42-AC57-F29EEA840A32@autouncle.com> (raw)
In-Reply-To: <CABUevEzJ9kd8hKyikzy9ROt4+NZcBSh367KkDWAFNZmWR2g5-Q@mail.gmail.com>
References: <02E032A0-7E7A-4CB3-9C76-5739B05660D5@autouncle.com>
<CABUevEzBZFjMz_UwiPuxfd1C-9ShutnRWtj5H6yy_1sYWnKy4A@mail.gmail.com>
<40D4328C-1761-4A2B-A579-7B69736BBAD6@autouncle.com>
<CABUevEzJ9kd8hKyikzy9ROt4+NZcBSh367KkDWAFNZmWR2g5-Q@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
Thanks! it worked! :-)
Den 18/03/2013 kl. 15.38 skrev Magnus Hagander <magnus@hagander.net>:
> On Mon, Mar 18, 2013 at 2:08 PM, Niels Kristian Schjødt
> <nielskristian@autouncle.com> wrote:
>> Okay, thanks. It' seems you were right! Now I have fixed the issue (it was an ssh key).
>> So I started a:
>> SELECT pg_start_backup('backup', true);
>>
>> And when done, I executed a:
>> sudo -u postgres rsync -av --exclude postmaster.pid --exclude pg_xlog /var/lib/postgresql/9.2/main/ postgres@192.168.0.2:/var/lib/postgresql/9.2/main/
>>
>> Then I tried to finish off the backup by doing a:
>> SELECT pg_stop_backup();
>>
>> But It keeps on telling me:
>> WARNING: pg_stop_backup still waiting for all required WAL segments to be archived (480 seconds elapsed)
>> HINT: Check that your archive_command is executing properly. pg_stop_backup can be canceled safely, but the database backup will not be usable without all the WAL segments.
>>
>> And I could see in the log that it's some kind of permission issue. So I canceled it, and started the streaming replication on my slave, and it seems to work fine. However the pg_xlog dir on the master is still HUGE 153G - so how can I get this mess sorted, and cleaned up that directory?
>
> Once you have your archive_command working, it will transfer all your
> xlog to the archive. Once it is, the xlog directory should
> automatically clean up fairly quickly.
>
> If you still have a permissions problem with the archive, you
> obviously need to fix that first.
>
> If you don't care about your archive you could set your
> archive_command to e.g. /bin/true, and that will make it pretend it
> has archived the files, and should clean it up quicker. But that will
> mean you have no valid archive and thus no valid backups, until you
> start over froma new base.
>
>
> --
> Magnus Hagander
> Me: http://www.hagander.net/
> Work: http://www.redpill-linpro.com/
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: nielskristian@autouncle.com, magnus@hagander.net
Subject: Re: Why is my pg_xlog directory so huge?
In-Reply-To: <1018C01B-F44B-4E42-AC57-F29EEA840A32@autouncle.com>
References: <02E032A0-7E7A-4CB3-9C76-5739B05660D5@autouncle.com> <CABUevEzBZFjMz_UwiPuxfd1C-9ShutnRWtj5H6yy_1sYWnKy4A@mail.gmail.com> <40D4328C-1761-4A2B-A579-7B69736BBAD6@autouncle.com> <CABUevEzJ9kd8hKyikzy9ROt4+NZcBSh367KkDWAFNZmWR2g5-Q@mail.gmail.com> <1018C01B-F44B-4E42-AC57-F29EEA840A32@autouncle.com>
* 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