Chapter 10. Configuring Slony

Slony is one of the most widespread replication solutions in the field of PostgreSQL. It is not just one of the oldest replication implementations, but also one that has the most support by external tools such as PgAdmin3 and others.

In this chapter we will take a deep look at Slony and learn how to integrate Slony into your replication setups. You will also find out which problems you can solve with Slony.

The following topics will be covered:

  • Installing Slony
  • The Slony system architecture
  • Replicating tables
  • Deploying DDLs
  • Handling failovers

Installing Slony

To install Slony we can download the most recent tarball from slony.info. As always we will perform a source installation so that you will be able to replicate a similar process for most operating systems.

For the purpose of this chapter we have used the following version of Slony:

http://slony.info/downloads/2.2/source/slony1-2.2.0.b3.tar.bz2

Once we have downloaded the package we can extract it running the following command:

tar xvfj slony1-2.2.0.b3.tar.bz2

The tarball will inflate and we can move forward to compile the code. To build the code we must tell Slony where to look for pg_config. The purpose of pg_config is to provide the add-on module with all the information about the build process of PostgreSQL itself. This way we can ensure that PostgreSQL and Slony are compiled the same way. On our demo setup PostgreSQL resides in /usr/local/pgsql so we can safely assume that PostgreSQL will reside in the bin directory of the installation:

./configure --with-pgconfigdir=/usr/local/pgsql/bin
make
su root
make install

Once we have executed configure, we can compile the code by calling make. Then we can switch to root (in case PostgreSQL has been installed as root) and install the binaries to their final destination.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.79.84