Solved

pgpool-II on Ubuntu 14.04... ARGH!

Posted on 2015-02-17
5
811 Views
Last Modified: 2015-05-14
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
Comment
Question by:Sophia Paterakis
  • 2
  • 2
5 Comments
 
LVL 1

Author Comment

by:Sophia Paterakis
ID: 40613916
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
 
LVL 61

Accepted Solution

by:
gheist earned 450 total points
ID: 40620072
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
 
LVL 22

Assisted Solution

by:earth man2
earth man2 earned 50 total points
ID: 40623188
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
 
LVL 61

Assisted Solution

by:gheist
gheist earned 450 total points
ID: 40623204
it is in package postgresl93-dev (or whatever matches postgresql installed)
0
 
LVL 1

Author Comment

by:Sophia Paterakis
ID: 40776996
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
After running Ubuntu some time, you will be asked to download updates for fixing bugs and security updates. All the packages you download replace the previous ones, except for the kernel, also called "linux-image". This is due to the fact that w…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now