Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

pgpool-II on Ubuntu 14.04... ARGH!

Posted on 2015-02-17
5
Medium Priority
?
1,104 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 62

Accepted Solution

by:
gheist earned 1800 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 200 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 62

Assisted Solution

by:gheist
gheist earned 1800 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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

609 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