Re: Shutdown Order with Primary/Standby?

From: Don Seiler <don(at)seiler(dot)us>
To: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Shutdown Order with Primary/Standby?
Date: 2017-08-10 18:14:53
Message-ID: CAHJZqBBWqr-RAnbow1PTzijbckGCwJ4ZiFs2+zZ2kTXy6Bn7wg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Yes we'll be shutting down the app servers in advance.

On Aug 10, 2017 1:13 PM, "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com> wrote:

> On Thu, Aug 10, 2017 at 11:59 AM, Don Seiler <don(at)seiler(dot)us> wrote:
> > Afternoon,
> >
> > Just wondering if there's a best practice in regards to shutdown of
> primary
> > and standbys, as I approach my first planned maintenance task as a newbie
> > PostgreSQL DBA. I found one older post that suggested doing a fast-mode
> > shutdown on primary first so that all transaction info can be cleanly
> pushed
> > to standby, then shutdown the standby. Our big app group runs on 9.2.18
> and
> > is being upgraded to 9.2.22.
> >
> > Extending that scenario, if you had a cascading standby, would you go
> > primary -> upstream standby -> downstream standby?
>
> Set keep wal segments to something largish (1000 or so) well before
> the upgrade etc. Make sure the volume holding pg_xlog can hold
> 1000*16MB of data. This ensures the streaming replicant can catch up
> if some stuff happens before it's back up.
>
> Best practices are to first eliminate client access to the db cluster
> so there's no updates going on up to the last second and all that. A
> great tool for this is pgbouncer, which can pause its connections
> while you do the upgrade.
>
> After that, it really doesn't matter the order, but yes, I generally
> shut down the source, then the destination machines.
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tang, Ronald K CIV FNMOC, N6 2017-08-10 21:02:28 Postgres user authentication with secure LDAP
Previous Message Scott Marlowe 2017-08-10 18:13:12 Re: Shutdown Order with Primary/Standby?