loading data into cluster - can I daisy-chain streaming replication?

Started by Florin Andreiover 10 years ago3 messagesgeneral
Jump to latest
#1Florin Andrei
florin@andrei.myip.org

I have an old production instance, let's call it A, that I need to
decommission soon.

I've created a pair of new instances, B and C, with B replicating to C,
following this procedure:

https://wiki.postgresql.org/wiki/Streaming_Replication

But B and C have no data yet. I need to transfer all data from A into B.

Can I daisy-chain streaming replication? In other words, temporarily
setup replication like this:

A ==> B ==> C

And after the transfer is done, just remove A from the scheme.

--
Florin Andrei
http://florin.myip.org/

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2Dennis
dennisr@visi.com
In reply to: Florin Andrei (#1)
Re: loading data into cluster - can I daisy-chain streaming replication?

Unfortunately, no can not do what you have proposed because to make B a slave of A requires that you make binary copy of A to B and then turn on replication from A to B which will break B to C replication.

What you can do with your current configuration is do a pg_dumpall or pg_dump of A and load that logical dump into B which would then replicate the data to C.

Dennis

On Dec 2, 2015, at 7:24 PM, Florin Andrei <florin@andrei.myip.org> wrote:

I have an old production instance, let's call it A, that I need to decommission soon.

I've created a pair of new instances, B and C, with B replicating to C, following this procedure:

https://wiki.postgresql.org/wiki/Streaming_Replication

But B and C have no data yet. I need to transfer all data from A into B.

Can I daisy-chain streaming replication? In other words, temporarily setup replication like this:

A ==> B ==> C

And after the transfer is done, just remove A from the scheme.

--
Florin Andrei
http://florin.myip.org/

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Jim Nasby
Jim.Nasby@BlueTreble.com
In reply to: Dennis (#2)
Re: loading data into cluster - can I daisy-chain streaming replication?

On 12/2/15 9:54 PM, Dennis wrote:

What you can do with your current configuration is do a pg_dumpall or pg_dump of A and load that logical dump into B which would then replicate the data to C.

IF you can't handle the downtime you could also setup londiste or Slony
and logically replicate A to B.

But (assuming A and B are binary compatible) you'd be better off just
breaking the B to C replication, setting B up as a replica of A, and
then setting C up as a replica of B.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general