How to install Pgpool-II in Debian etch (4)
PGPOOL-II
Introduction
pgpool-II is a middleware that works between PostgreSQL servers and a PostgreSQL database client. It
provides the following features.
1. Connection Pooling
2. Replication
3. Load Balance
4. Limiting Exceeding Connections
5. Parallel Query
pgpool-II talks PostgreSQL's backend and frontend protocol, and relays a connection between them. Therefore,
a database application (frontend) thinks that pgpool-II is the actual PostgreSQL server, and the server
(backend) sees pgpool-II as one of its clients. Because pgpool-II is transparent to both the server and the client,
an existing database application can be used with pgpool-II almost without a change to its sources.
Getting source
Pgpool-II source files can be down loaded from the following link.
http://pgfoundry.org/projects/pgpool/
Version 2.2.5 tar ball is to be downloaded to a temporary directory (Home)
Then extract the tarball (Right click on the file pgpoolII2.2.5.tar.gz and
select Extract here )
Prerequisit
Postgresql 8.1deb package has to be installed in addition to the normal
postgresql installation
Installation
In terminal login as root.
$ su
#cd pgpoolII2.2.5
#./configure
#make
#make install
Binaries will be installed to /usr/local/bin
configuration file location /usr/local/etc
sample configuration files will be installed at the above location
This files are to be renamed as shown below.
pgpool.conf.sample >pgpool.conf
pcp.conf.sample >pcp.conf
In the pgpool .conf file following changes are to be made
Unix domain socket changed from /tmp to /var/run/postgresql
log directory is to be changed to /var/run/pgpool
The directory /var/run/pgpool is to be created manually
change ownership of this folder to postgresql by issuing the following command in
the root terminal.
chown postgres /var/run/pgpool
C Language function Installation
This is necessary to perform online recovery of the database.
In the root terminal
#cd pgpoolII2.2.3/sql/pgpoolrecovery
#make install
(A file named pgpoolrecovery.sql will be generated by the above command)
#psql U postgres f pgpoolrecovery.sql template1
pgpoolrecovery.sql is a database dump file which will be restored to template1
database
This will provide C language functionalities to all database created from
template1