• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1168
  • Last Modified:

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.
0
Sophia Paterakis
Asked:
Sophia Paterakis
  • 2
  • 2
3 Solutions
 
Sophia PaterakisAuthor Commented:
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).
0
 
gheistCommented:
You first need to read ubuntu manuals and install postgresql-dev  package to build any modules.
What was not working in ubuntu-supplied package? What problem the new version fixes? Was it rejected as a bug report? Heard of backports?

Ubuntu 12.04 has pgpool v3.1 which is still stable and supported version.
0
 
earth man2Commented:
Your Makefile is not finding the postgres.h file.
If you can't correct the Makefile try putting the postgres.h file somewhere standard like /usr/include  BUT MAKE SURE YOU DON'T OVERWRITE AN EXISTING file !
0
 
gheistCommented:
it is in package postgresl93-dev (or whatever matches postgresql installed)
0
 
Sophia PaterakisAuthor Commented:
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

0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now