Changing the Cluster Topology (Re-mastering and Failover)

Slony makes it very easy to change the topology of a replication cluster. Let's say that business at the Boomtown store is really booming (ouch) and you want to lighten the load on the boomtown server. boomtown pulls replication data from springfield and forwards the data to snoozeville. You can tell snoozeville to pull its replication data directly from springfield by re-subscribing snoozeville and specifying a different provider (see Listing 24.9).

Listing 24.9. changeProvider.sk
#!/usr/local/bin/slonik

# File: changeProvider.sk
include <preamble.sk>;

subscribe set ( id = 1, provider = @SPRINGFIELD, 
                                   receiver = @SNOOZEVILLE, forward = no );

That's nearly identical to the previous ...

Get PostgreSQL, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.