Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aSFcI-00049f-2F for pgsql-admin@arkaria.postgresql.org; Sun, 07 Feb 2016 03:02:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aSFcH-0003AC-F0 for pgsql-admin@arkaria.postgresql.org; Sun, 07 Feb 2016 03:02:25 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aSFab-0001IA-Of for pgsql-admin@postgresql.org; Sun, 07 Feb 2016 03:00:41 +0000 Received: from tamriel.snowman.net ([2001:4830:167b::11]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1aSFaY-00031y-KR for pgsql-admin@postgresql.org; Sun, 07 Feb 2016 03:00:40 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id DE8455F795; Sat, 6 Feb 2016 22:00:37 -0500 (EST) Date: Sat, 6 Feb 2016 22:00:37 -0500 From: Stephen Frost To: Dave Johansen Cc: Shreeyansh Dba , "pgsql-admin@postgresql.org" Subject: Re: Setting up streaming replication with new server as master? Message-ID: <20160207030037.GL3331@tamriel.snowman.net> References: <20160205202729.GZ3331@tamriel.snowman.net> <20160205205456.GA3331@tamriel.snowman.net> <20160205210928.GB3331@tamriel.snowman.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="7AAf1pfr5RnNeEo0" Content-Disposition: inline In-Reply-To: X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.13.0-61-generic (x86_64) X-Uptime: 21:54:50 up 186 days, 11:25, 8 users, load average: 0.09, 0.07, 0.05 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -2.3 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org --7AAf1pfr5RnNeEo0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Dave, * Dave Johansen (davejohansen@gmail.com) wrote: > On Fri, Feb 5, 2016 at 8:29 PM, Shreeyansh Dba > wrote: > > On Saturday, February 6, 2016, Dave Johansen > > wrote: > >> Just to clarify, do you mean *wal_level* set to archive or higher (i.e. > >> wal_level instead of archive_mode)? Yes, sorry about the confusion. > >> One final question, step #5 in "How to Use" ( > >> https://wiki.postgresql.org/wiki/Streaming_Replication#How_to_Use ) > >> makes it sounds like having wal_keep_segments at a high enough level m= eans > >> that archive_mode being on isn't necessary. Is that a correct understa= nding > >> of the description there? Yes. > > If you are using PostgreSQL version greater than 9.1 then you can go for > > pg_basebackup and create recovery.conf in backup . >=20 > I'm using 9.2 on RHEL 7.2, so it sounds like that's a good option. Right, that should work. > > I suggest you to go for wal to wal replication so that the archive > > overhead will reduce. > > > > Put wal_keep_segment=3D150. > > Also > > Wal_level =3D hot_standby > > > > Not necessary to enable archive_mode and archive_command. >=20 > Ok, I'll go with that and thanks for the clarification. Yeah, note that 150 WAL segments will be like 2.5G, so make sure you have enough disk space on your WAL volume for them. > > Once the replication comes in sync you can take down time in off peak > > hours and promote the slave. >=20 > Is there a recommended way to migrate the data that was added after the u= se > of pg_basebackup happened and before the processing was taken offline? If you set up the new server as a streaming replica then the data which is added after the pg_basebackup will be streamed automatically to the new server, all the way up til the current server is taken offline. Thanks! Stephen --7AAf1pfr5RnNeEo0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJWtrNVAAoJEO1sijiDR2RV5psP/2N3rZ61+W6iQ2WyZRndRN1Y p9jvmXDgCtOA/v0fmzgpMyecJVoMC8hIHqfxiWuWe5VkuKKRqsdV1b7CqLT2UT49 6cwkR0Sqeoa0t9pJCruAigrc4V90w0Kd1f6OcxEuUSIyvggNlFJuzj7F02LpLAE9 GoNGXHVs0iRaPeQkyUVH/nejCvc7quVEbKl37gzE7hrNMP17Ft6NPvRviWHCDoyd CwG/McmvsBfPfW/wvmUA5RY0nIHB+QIR3AmbWQT2hgjR+N4nooXTTwfZe8heeJFV GpEZESgy0AxTvSfEC6bAlHd2cMbbT4CGggOj0yg3DokQnLjV/c7RJiEUFZCn6IOl WQwn6Wb46qB4jNfeOFTfRgpDWBPlXkagHL8Gs0ZU6Np2ooGtPUS/eS6w4vgI6373 ax2UUiGrSxJf+CG7OWRWdTv7nYtGNLapw8AcYvXELdk1G6/JMYphGZxOFWfRaIvQ ex78imMw2eUy86McIOd3f+zOLA2LhQQ3hCmfSeJqwoZ0th6nqA2eKkfjg67rmt88 mEgsC+8W27hWMAkKfPL29RHQMEPy1L4z4HZ3B2InTsziT6XOrKK92IP1YOyceHDX 2giIHXBTe/o8fSBUWskl10TGSCu7OSNJLDd9vv5r1LsjgOsJannGBJAP6Rw9W0Gu 55gHZ4ujl0fMLWeOtD05 =Y2zq -----END PGP SIGNATURE----- --7AAf1pfr5RnNeEo0--