For Windows™ users: Unless you are planning on hacking the Slony-I code, it is highly recommended that you download and install a prebuilt binary distribution and jump straight to the configuration section below. There are likely to be links and/or binaries at pgFoundry Slony-I site .
There are also RPM binaries available at that site for recent versions of Slony-I for recent versions of PostgreSQL.
This section discusses building Slony-I from source.
You should have obtained the Slony-I source from the previous step. Unpack it.
gunzip slony.tar.gz; tar xf slony.tar
This will create a directory under the current directory with the Slony-I sources. Head into that that directory for the rest of the installation procedure.
PGMAIN=/usr/local/pgsql839-freebsd-2008-09-03 \ ./configure \ --with-pgconfigdir=$PGMAIN/bin gmake all; gmake install
Slony-I normally needs to be built and installed by the PostgreSQL Unix user. The installation target must be identical to the existing PostgreSQL installation particularly in view of the fact that several Slony-I components represent libraries and SQL scripts that need to be in the Slony-I lib and share directories.
The first step of the installation procedure is to configure the source tree for your system. This is done by running the configure script.Slony-I is configured by pointing it to the various PostgreSQL library, binary, and include directories. For a full list of these options, use the command ./configure --help.
It is sufficient, for the purposes of building a usable build,
to run configure
where /some/path/somewhere is the directory where
the PostgreSQL program pg_config is
located. Based on the output of pg_config,
the configure script determines the various
locations where PostgreSQL components are found, which indicate where
the essential components of Slony-I must be installed.
For a full listing of configuration options, run the command ./configure --help.
Beware: configure defaults to permit indicating values for various paths, including "generic" values:
There are also PostgreSQL-specific options specified, which should not be expressly set, as pg_config should already provide correct values:
The compile of PostgreSQL must be expressly configured with the option --enable-thread-safety to provide correct client libraries.
Slony-I requires that the PostgreSQL server headers be installed. Some binary distributions of PostgreSQL include this is a a -dev package.
After running configure, you may wish to review the file Makefile.global to ensure it is looking in the right places for all of the components.
After determining that the PostgreSQL instance to be used is installed in /opt/dbs/pgsql746-aix-2005-04-01:
PGMAIN=/opt/dbs/pgsql746-aix-2005-04-01 \ ./configure \ --with-pgconfigdir=$PGMAIN/bin
The configure script will run a number of tests to guess values for various dependent variables and try to detect some quirks of your system. Slony-I is known to need a modified version of libpq on specific platforms such as Solaris2.X on SPARC. A patch for libpq version 7.4.2 can be found at http://developer.postgresql.org/~wieck/slony1/download/threadsafe-libpq-742.diff.gz Similar patches may need to be constructed for other versions.
To start the build process, type
Be sure to use GNU make; on BSD systems, it is called gmake; on Linux, GNU make is typically the "native" make, so the name of the command you type in may be either make or gmake. On other platforms, you may need additional packages or even install GNU make from scratch. The build may take anywhere from a few seconds to 2 minutes depending on how fast your hardware is at compiling things. The last line displayed should be
All of Slony-I is successfully made. Ready to install.
To install Slony-I, enter gmake install
This will install files into the postgresql install directory as
specified by the configure
--prefix option used in the PostgreSQL installation.
Make sure you have appropriate permissions to write into that area.
Commonly you need to do this either as root or as the postgres user.
The main list of files installed within the PostgreSQL instance is, for versions of Slony-I
The document you are reading now is a fairly extensive "Administrator's Guide" containing what wisdom has been discovered and written down about the care and feeding of Slony-I.
This is only built if you specify --with-docs
Note that you may have difficulty building the documentation on older Red Hat systems (RHEL4 and below) See Bug 159382 (For RHEL) See the INSTALL file for a workaround for Fedora...
A pre-built copy of the "admin guide" should be readily available, either in the form of a separate tarball nearby, or in the directory doc/adminguide/prebuilt
Even though Slony-I can be compiled and run on most Linux distributions, it is also possible to install Slony-I using binary packages. Slony Global Development Team provides official RPMs and SRPMs for many versions or Red Hat and Fedora .
The RPMs are available at PostgreSQL RPM Repository. Please read the howto provided in the website for configuring yum to use that repository. Please note that the RPMs will look for RPM installation of PostgreSQL, so if you install PostgreSQL from source, you should manually ignore the RPM dependencies related to PostgreSQL.
Installing Slony-I using these RPMs is as easy as installing any RPM.
yum install slony1
yum will pick up dependencies. This repository provides Slony-I binaries built against every supported PostgreSQL version.
The RPM installs the files into their usual places. The configuration files are installed under /etc, the binary files are installed in /usr/bin, libraries are installed in /usr/lib/pgsql, and finally the docs are installed in /usr/share/doc/slony1.
On Windows™ systems, instead of running one slon(1) daemon per node, a single slon service is installed which can then be controlled through the Services control panel applet, or from a command prompt using the net command.
C:\Program Files\PostgreSQL\8.3\bin> slon -regservice my_slon Service registered. Before you can run Slony, you must also register an engine! WARNING! Service is registered to run as Local System. You are encouraged to change this to a low privilege account to increase system security.
Once the service is installed, individual nodes can be setup by registering slon configuration files with the service.
C:\Program Files\PostgreSQL\8.3\bin> slon -addengine c:\node1.conf Engine added.
Other, self explanatory commands include slon -unregservice <service name>, slon -listengines <service name> and slon -delengine <service name> <config file>.
For further information about the Windows™ port, you may want to see the following URLs: