Link to home
Start Free TrialLog in
Avatar of Sophia Paterakis
Sophia PaterakisFlag for United States of America

asked on

pgpool-II on Ubuntu 14.04... ARGH!

I'm trying to install pgpool-II on Ubuntu, but I keep hitting roadblocks.

1. I started with apt-get, but it installed a woefully old version of pgpool

2. I download the source and built it, now I have 3.4.1 running... all good, except:

3. I can't get the pgpool-regclass to compile or be available for installation into the template1 database. :-/

QUESTION:  Where can I get pgpool-II v3.4.1  pre-packaged for Ubuntu 14.04, that includes the necessary pgpool-regclass.sql scripts?

ALTERNATIVE QUESTION: How can I build pgpool-II on Ubuntu 14.04, which also includes the pgpool-regclass.sql scripts?

I've managed to build the "pgpool" binary, but the sql scripts are eluding me. :-/  The error I'm getting is:

root@pgpool-1:~/pgpool/pgpool-II-3.4.1/src/sql/pgpool-regclass# make
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fpic -I. -I. -I/usr/include/postgresql/server -I/usr/include/postgresql/internal -D_GNU_SOURCE   -c -o pgpool-regclass.o pgpool-regclass.c
pgpool-regclass.c:26:22: fatal error: postgres.h: No such file or directory
 #include "postgres.h"
                      ^
compilation terminated.
make: *** [pgpool-regclass.o] Error 1

Open in new window



The header file does exist, as I've managed to build and install PostgreSQL:

root@pgpool-1:~# find / -name postgres.h -print
/usr/local/pgsql/include/server/postgres.h
/root/postgres/postgresql-9.3.6/src/include/postgres.h

Open in new window


I've added the path to the Makefile, but I'm not sure what's going wrong. :-/

root@pgpool-1:~/pgpool/pgpool-II-3.4.1/src/sql/pgpool-regclass# cat Makefile
MODULES = pgpool-regclass
DATA_built = pgpool-regclass.sql
DATA = uninstall_pgpool-regclass.sql

EXTENSION = pgpool_regclass
DATA = pgpool_regclass--1.0.sql

# if you are using PostgreSQL 8.0 or later,
# using pg_config is recommended.
# if you are not, comment out following line and...
USE_PGXS = true
# set top_builddir to the PostgreSQL build source tree top.
# (for example /usr/local/src/postgresql-8.4)
## top_builddir = ../..
## top_builddir = /root/postgres/postgresql-9.3.6
top_builddir = /root/postgres/postgresql-9.3.6

ifdef USE_PGXS
PG_CONFIG = pg_config
PGXS = $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
subdir = contrib/pgpool-regclass
#top_builddir = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
endif

Open in new window


Thanks.
Avatar of Sophia Paterakis
Sophia Paterakis
Flag of United States of America image

ASKER

Alternatively... can you tell me if pgpool_regclass is even required?  I'm using Streaming Replication for my PostgreSQL replication, and this (albeit old) thread seems to say it's not really necessary:

http://lists.pgfoundry.org/pipermail/pgpool-general/2011-April/003562.html

Oh ok, in master/slave mode, timestamp rewriting is not peformed. So
you don't need to install pgool_regclass.
--
Tatsuo Ishii
SRA OSS, Inc. Japan

But the documentation doesn't mention this at all...

http://www.pgpool.net/docs/latest/pgpool-en.html
If you are using PostgreSQL 8.0 or later, installing pgpool_regclass function on all PostgreSQL to be accessed by pgpool-II is strongly recommended, as it is used internally by pgpool-II. Without this, handling of duplicate table names in different schema might cause trouble (temporary tables aren't a problem).
ASKER CERTIFIED SOLUTION
Avatar of gheist
gheist
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of earth man2
earth man2
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I ended up building it from source on the pgpool-II servers:

sudo su -
cd
mkdir pgpool
cd pgpool
wget http://www.pgpool.net/download.php?f=pgpool-II-3.4.2.tar.gz -O pgpool-II-3.4.2.tar.gz
gunzip -c pgpool-II-3.4.2.tar.gz | tar xvf -
cd pgpool-II-3.4.2
./configure --with-pam
make clean
make
make install

Open in new window



Then I built the regclass stuff on the PostgreSQL database server:

cd /root/pgpool/pgpool-II-3.4.2/src/sql/pgpool-regclass
cp Makefile Makefile.orig
vi Makefile
diff Makefile Makefile.orig
11c11
< ## USE_PGXS = true
---
> USE_PGXS = true
14c14
< top_builddir = /root/postgres/postgresql-9.3.6
---
> top_builddir = ../..
make
make install
#
cd /root/pgpool/pgpool-II-3.4.1/src/sql/pgpool-recovery
cp Makefile Makefile.orig
vi Makefile
diff Makefile Makefile.orig
11c11
< ## USE_PGXS = true
---
> USE_PGXS = true
14c14
< top_builddir = /root/postgres/postgresql-9.3.6
---
> top_builddir = ../..
make
make install
#
cd /root/pgpool/pgpool-II-3.4.1/src/sql/pgpool_adm
cp Makefile Makefile.orig
vi Makefile
diff Makefile Makefile.orig
11c11
< ## USE_PGXS = true
---
> USE_PGXS = true
14c14
< top_builddir = /root/postgres/postgresql-9.3.6
---
> top_builddir = ../..
make
make install

Open in new window


Then I loaded it into the template1 database:

postgres=# CREATE EXTENSION pgpool_recovery;
CREATE EXTENSION
postgres=# CREATE EXTENSION pgpool_regclass;
CREATE EXTENSION

Open in new window