Re: URGENT issue: pg-xlog growing on master!

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Niels Kristian Schjødt <nielskristian(at)autouncle(dot)com>
Cc: "pgsql-performance(at)postgresql(dot)org list" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: URGENT issue: pg-xlog growing on master!
Date: 2013-06-10 18:24:45
Message-ID: CAMkU=1yrOnRWA+ETgyo3hv7wHW=JDrvrZq++pktrytcgt=-ScA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Mon, Jun 10, 2013 at 11:02 AM, Niels Kristian Schjødt <
nielskristian(at)autouncle(dot)com> wrote:

> Okay, cool
>
> You mean that I should do the following right?:
>
> 1. Stop slave server
>

At this point, you don't have a slave server. Not a usable one, anyway.
If you used to have a hot-standby server, it is now simply a historical
reporting server. If you have no need/use for such a reporting server,
then yes you should stop it, to avoid confusion.

> 2. set archive_command = 'true' in postgresql.conf on the master server
> 3. restart master server
>

You can simply do a reload rather than a full restart.

> 4. run psql -c "SELECT pg_start_backup('label', true)" on master
>

No, you shouldn't do that yet without first having correctly functioning
archiving back in place. After setting archive_command=true and reloading
the server, you have to wait a while for the "bad" WAL files to get
pseudo-archived and cleared from the system. Once that has happened, you
can then return archive_command to its previous setting, and again
reload/restart the server. Only at that point should you begin taking the
new backup. In other words, steps 7 and 8 have to be moved up to before
step 4.

> 5. run rsync -av --exclude postmaster.pid --exclude pg_xlog
> /var/lib/postgresql/9.2/main/ postgres(at)192(dot)168(dot)0(dot)2:/var/lib/postgresql/9.2/main/" on
> master server
> 6. run psql -c "SELECT pg_stop_backup();" on master server
> 7. change archive_command back on master
> 8. restart master
> 9. start slave
>
> Just to confirm the approach :-)
>

Cheers,

Jeff

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Niels Kristian Schjødt 2013-06-10 18:31:18 Re: URGENT issue: pg-xlog growing on master!
Previous Message Niels Kristian Schjødt 2013-06-10 18:02:40 Re: URGENT issue: pg-xlog growing on master!