How to do it...

For these instructions, 192.168.56.10 is the master PostgreSQL node, and 192.168.56.30 is our desired subscriber. Follow these instructions to activate Slony on the postgres default database:

  1. Extract the source code and change to the resulting directory with these commands:
        tar -xjf slony1-2.2.5.tar.bz2
        cd slony1-2.2.5
  1. Build and install Slony with these commands as a root-capable user:
        ./configure --prefix=/usr
        make
        sudo make install
  1. Repeat the above two steps on the subscriber node to ensure necessary libraries are available to Slony.
  2. Provide the rep_user database user with superuser capabilities by running this SQL statement on both PostgreSQL nodes:
        ALTER USER rep_user WITH SUPERUSER;
  1. Enter the following line ...

Get PostgreSQL High Availability Cookbook - 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.