Re: Migrating to PG 9.2 (LONG, SORRY)

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Scott Whitney <swhitney(at)journyx(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Migrating to PG 9.2 (LONG, SORRY)
Date: 2012-10-04 01:18:03
Message-ID: 20121004011803.GO1267@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

* Scott Whitney (scott(at)journyx(dot)com) wrote:
> 1)Add to pg_hba.conf on master:
> host replication postgres my IP/32 trust

Never use 'trust'. At least use 'md5', all that requires is putting a
password into your replication config.

> 2) Configure in postgresql.conf on master:
> wal_level = hot_standby
> max_wal_senders = 5
> wal_keep_segments = SOME NUMBER I HAVE TO DETERMINE BASED ON HOW LONG THE BACKUP ETC TAKES.
>
> # Maybe do this if the above is not high enough
> #archive_mode = on
> #archive_command = 'cp %p /path_to/archive/%f'

You should definitely have a mechanism for the WALs to be transferred to
the replica(s) on a regular basis. Don't just rely on the replication
connection. With this, you don't have to worry as much about the
wal_keep_segments option above...

> 3) Add to postgresql.conf on standby:
> hot_standby = on
>
> 4) Create a recovery.conf on the standby (in $PGDATA):
> standby_mode = 'on'
> primary_conninfo = 'host=master IP port=5432 user=postgres'

In primary_conninfo is where you'd put the password for md5 auth.

> 5)Do my backup from the STANDBY AT THE DATA CETNER

I think the typical approach is to use the same copy of the master that
you did for the intial slave when doing the cascaded slave..
Regardless, and with all of this, test, test, test.

Thanks,

Stephen

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Christian Ullrich 2012-10-05 15:07:57 Re: Creating schema best practices
Previous Message Greg Williamson 2012-10-03 21:53:51 Re: Database size stays constant but disk space keeps shrinking -- postgres 9.1