EnterpriseDB installed PostgreSQL 9.6 vs. REPMGR. Round 2 - compilation issues.
Hello.
Yesterday I had problems getting repmgr installed, since our PostgreSQL
installs to a non-standard place, and doesn't use any postgresql
repositories/packages. The responses I got generally seemed to be 'you
need to compile it'.
Time for round 2, trying to compile it with our own environment. Many
apologies if I'm doing something obviously stupid, I have *very little*
experience with compiling things on linux.
To speed things up I'm doing my attempted compiles on my laptop instead
of our servers, since I can install packages etc as required myself
without having to wait on our tech support team. I want to verify that I
can get repmgr up and running on as minimal a test server as I can
before rolling it out to slightly more hefty boxes :)
I'm running ubuntu server 17.04. The EnterpriseDB installer was used to
quickly install a quick test PostgreSQL db, "testdb" under owning userid
"testdb". Here is the output of pg_config:
testdb@repm:/postgresql/software/repmgr/repmgr-3.3.1$ pg_config
BINDIR = /postgresql/software/pg/9.6.2/bin
DOCDIR = /postgresql/software/pg/9.6.2/doc/postgresql
HTMLDIR = /postgresql/software/pg/9.6.2/doc/postgresql
INCLUDEDIR = /postgresql/software/pg/9.6.2/include
PKGINCLUDEDIR = /postgresql/software/pg/9.6.2/include/postgresql
INCLUDEDIR-SERVER = /postgresql/software/pg/9.6.2/include/postgresql/server
LIBDIR = /postgresql/software/pg/9.6.2/lib
PKGLIBDIR = /postgresql/software/pg/9.6.2/lib/postgresql
LOCALEDIR = /postgresql/software/pg/9.6.2/share/locale
MANDIR = /postgresql/software/pg/9.6.2/share/man
SHAREDIR = /postgresql/software/pg/9.6.2/share/postgresql
SYSCONFDIR = /postgresql/software/pg/9.6.2/etc/postgresql
PGXS =
/postgresql/software/pg/9.6.2/lib/postgresql/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--enable-debug' '--with-libs=/opt/local/Current/lib'
'--with-includes=/opt/local/Current/include/libxml2:/opt/local/Current/include'
'--prefix=/mnt/hgfs/pginstaller.auto/server/staging/linux-x64'
'--with-ldap' '--with-openssl' '--with-perl' '--with-python'
'--with-tcl'
'--with-tclconfig=/opt/local/EnterpriseDB/LanguagePack/9.6/Tcl-8.5/lib'
'--with-pam' '--enable-thread-safety' '--with-libxml' '--with-ossp-uuid'
'--docdir=/mnt/hgfs/pginstaller.auto/server/staging/linux-x64/doc/postgresql'
'--with-libxslt' '--with-libedit-preferred' '--with-gssapi'
'LD_LIBRARY_PATH=/opt/local/Current/lib' 'CFLAGS=-O2 -DMAP_HUGETLB=0x40000'
CC = gcc
CPPFLAGS = -DFRONTEND -D_GNU_SOURCE -I/opt/local/Current/include/libxml2
-I/opt/local/Current/include
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -g -O2 -DMAP_HUGETLB=0x40000
CFLAGS_SL = -fpic
LDFLAGS = -L../../src/common -L/opt/local/Current/lib -Wl,--as-needed
-Wl,-rpath,'/mnt/hgfs/pginstaller.auto/server/staging/linux-x64/lib',--enable-new-dtags
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lxslt -lxml2 -lpam -lssl -lcrypto
-lgssapi_krb5 -lz -ledit -lrt -lcrypt -ldl -lm
VERSION = PostgreSQL 9.6.2
testdb@repm:/postgresql/software/repmgr/repmgr-3.3.1$
PostgreSQL is up and running nicely:
testdb@repm:/postgresql/software/repmgr/repmgr-3.3.1$ pg_ctl status
pg_ctl: server is running (PID: 1433)
/postgresql/software/pg/9.6.2/bin/postgres
First attempt at compilation was unsuccessful and so I followed the
advice in PACKAGES.md:When building repmgr against a Debian packages
build, you may discover that some development packages are needed as
well. You will need the following development packages installed:
|sudo apt-get install libxslt-dev libxml2-dev libpam-dev libedit-dev|
Here's the output I now get when checking those packages:
testdb@repm:/postgresql/software/repmgr/repmgr-3.3.1$ sudo apt-get
install libxslt-dev libxml2-dev libpam-dev libedit-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libxslt1-dev' instead of 'libxslt-dev'
Note, selecting 'libpam0g-dev' instead of 'libpam-dev'
libedit-dev is already the newest version (3.1-20160903-3).
libpam0g-dev is already the newest version (1.1.8-3.2ubuntu2).
libxml2-dev is already the newest version (2.9.4+dfsg1-2.2).
libxslt1-dev is already the newest version (1.1.29-2ubuntu0.1).
0 to upgrade, 0 to newly install, 0 to remove and 4 not to upgrade.
It also recommends installing the postgres server dev
|sudo apt-get install postgresql-server-dev-9.0|
testdb@repm:/postgresql/software/repmgr/repmgr-3.3.1$ sudo apt-get
install postgresql-server-dev-9.6
Reading package lists... Done
Building dependency tree
Reading state information... Done
postgresql-server-dev-9.6 is already the newest version (9.6.2-1).
0 to upgrade, 0 to newly install, 0 to remove and 4 not to upgrade.
Already installed for 9.6 - had to install it for pg_config.
So I've already got installed the packages that PACKAGES.MD recommends,
I guess. Attempts to compile repmgr are now failing with:
(In the directory with the expanded tar file):
testdb@repm:/postgresql/software/repmgr/repmgr-3.3.1$ ls
check_dir.c compat.h CONTRIBUTING.md dbutils.c dirmod.c
errcode.h HISTORY log.h QUICKSTART.md repmgr.conf.sample
repmgr.sql strutil.c uninstall_repmgr.sql
check_dir.h config.c COPYRIGHT dbutils.h dirmod.h
FAILOVER.rst LICENSE Makefile README.md repmgrd.c
sql strutil.h version.h
compat.c config.h CREDITS debian docs FAQ.md
log.c PACKAGES.md repmgr.c repmgr.h SSH-RSYNC.md TODO)
testdb@repm:/postgresql/software/repmgr/repmgr-3.3.1$ sudo make
USE_PGXS=1 install
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv
-fexcess-precision=standard -g -g -O2
-fdebug-prefix-map=/build/postgresql-9.6-jQU1kx/postgresql-9.6-9.6.2=.
-fstack-protector-strong -Wformat -Werror=format-security
-I/usr/include/mit-krb5 -fPIC -pie -fno-omit-frame-pointer
-I/usr/include/postgresql -I. -I./ -I/usr/include/postgresql/9.6/server
-I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2
-D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/tcl8.6 -c -o
dbutils.o dbutils.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv
-fexcess-precision=standard -g -g -O2
-fdebug-prefix-map=/build/postgresql-9.6-jQU1kx/postgresql-9.6-9.6.2=.
-fstack-protector-strong -Wformat -Werror=format-security
-I/usr/include/mit-krb5 -fPIC -pie -fno-omit-frame-pointer
-I/usr/include/postgresql -I. -I./ -I/usr/include/postgresql/9.6/server
-I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2
-D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/tcl8.6 -c -o
config.o config.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv
-fexcess-precision=standard -g -g -O2
-fdebug-prefix-map=/build/postgresql-9.6-jQU1kx/postgresql-9.6-9.6.2=.
-fstack-protector-strong -Wformat -Werror=format-security
-I/usr/include/mit-krb5 -fPIC -pie -fno-omit-frame-pointer
-I/usr/include/postgresql -I. -I./ -I/usr/include/postgresql/9.6/server
-I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2
-D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/tcl8.6 -c -o
repmgrd.o repmgrd.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv
-fexcess-precision=standard -g -g -O2
-fdebug-prefix-map=/build/postgresql-9.6-jQU1kx/postgresql-9.6-9.6.2=.
-fstack-protector-strong -Wformat -Werror=format-security
-I/usr/include/mit-krb5 -fPIC -pie -fno-omit-frame-pointer
-I/usr/include/postgresql -I. -I./ -I/usr/include/postgresql/9.6/server
-I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2
-D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/tcl8.6 -c -o log.o
log.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv
-fexcess-precision=standard -g -g -O2
-fdebug-prefix-map=/build/postgresql-9.6-jQU1kx/postgresql-9.6-9.6.2=.
-fstack-protector-strong -Wformat -Werror=format-security
-I/usr/include/mit-krb5 -fPIC -pie -fno-omit-frame-pointer
-I/usr/include/postgresql -I. -I./ -I/usr/include/postgresql/9.6/server
-I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2
-D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/tcl8.6 -c -o
strutil.o strutil.c
gcc -o repmgrd -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv
-fexcess-precision=standard -g -g -O2
-fdebug-prefix-map=/build/postgresql-9.6-jQU1kx/postgresql-9.6-9.6.2=.
-fstack-protector-strong -Wformat -Werror=format-security
-I/usr/include/mit-krb5 -fPIC -pie -fno-omit-frame-pointer dbutils.o
config.o repmgrd.o log.o strutil.o -L/usr/lib/x86_64-linux-gnu
-lpgcommon -lpgport -L/usr/lib/x86_64-linux-gnu -lpq
-L/usr/lib/x86_64-linux-gnu -Wl,-Bsymbolic-functions -Wl,-z,relro
-Wl,-z,now -Wl,--as-needed -L/usr/lib/mit-krb5
-L/usr/lib/x86_64-linux-gnu/mit-krb5 -Wl,--as-needed -lpgcommon
-lpgport -lselinux -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz
-ledit -lrt -lcrypt -ldl -lm
/usr/bin/ld: cannot find -lselinux
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
/usr/bin/ld: cannot find -lgssapi_krb5
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
Makefile:20: recipe for target 'repmgrd' failed
make: *** [repmgrd] Error 1
Any ideas what I am doing wrong? I can only assume I'm missing something
really, really, obvious. Every single book and article I've seen simply
states 'Just quickly install repmgr then ...' - it's driving me nuts
that I can't get this thing installed, let alone working :)
Any help/advice/suggestions/pointing-outs-of-the-obvious would be
greatly appreciated.
Regards,
Martin.
--
Martin Goodson
"Have you thought up some clever plan, Doctor?"
"Yes, Jamie, I believe I have."
"What're you going to do?"
"Bung a rock at it."
On 05/12/2017 08:13 AM, Martin Goodson wrote:
Hello.
Yesterday I had problems getting repmgr installed, since our PostgreSQL
installs to a non-standard place, and doesn't use any postgresql
repositories/packages. The responses I got generally seemed to be 'you
need to compile it'.I'm running ubuntu server 17.04. The EnterpriseDB installer was used to
quickly install a quick test PostgreSQL db, "testdb" under owning userid
"testdb". Here is the output of pg_config:
This is your problem. As Adrian already mentioned, you should be running
the PGDG apt repos.
https://www.postgresql.org/download/linux/ubuntu/
Universal installers are great for a one off, "Hey let's see what we can
do!" but they are not useful once you want to extend, have community
support and or do things like easily install Repmgr.
Good luck!
JD
--
Command Prompt, Inc. http://the.postgres.company/
+1-503-667-4564
PostgreSQL Centered full stack support, consulting and development.
Everyone appreciates your honesty, until you are honest with them.
Unless otherwise stated, opinions are my own.
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
On 12/05/2017 16:18, Joshua D. Drake wrote:
On 05/12/2017 08:13 AM, Martin Goodson wrote:
Hello.
Yesterday I had problems getting repmgr installed, since our PostgreSQL
installs to a non-standard place, and doesn't use any postgresql
repositories/packages. The responses I got generally seemed to be 'you
need to compile it'.I'm running ubuntu server 17.04. The EnterpriseDB installer was used to
quickly install a quick test PostgreSQL db, "testdb" under owning userid
"testdb". Here is the output of pg_config:This is your problem. As Adrian already mentioned, you should be
running the PGDG apt repos.https://www.postgresql.org/download/linux/ubuntu/
Universal installers are great for a one off, "Hey let's see what we
can do!" but they are not useful once you want to extend, have
community support and or do things like easily install Repmgr.Good luck!
JD
Thanks for the response. The problem is I'm kind of stuck with using
EnterpriseDB's community edition installers. It's a company policy. I
can't install PostgreSQL using repositories, I ** have ** to use the
'Universal Installer' from EnterpriseDB.
Surely there must be a way to build repmgr for, and integrate it into, a
PostgreSQL db cluster built using EnterpriseDB? Am I really somehow
running up against a hard limit or am I simply missing something?
Regards,
Martin.
--
Martin Goodson
"Have you thought up some clever plan, Doctor?"
"Yes, Jamie, I believe I have."
"What're you going to do?"
"Bung a rock at it."
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
On 05/12/2017 08:13 AM, Martin Goodson wrote:
Hello.
Yesterday I had problems getting repmgr installed, since our PostgreSQL
installs to a non-standard place, and doesn't use any postgresql
repositories/packages. The responses I got generally seemed to be 'you
need to compile it'.Time for round 2, trying to compile it with our own environment. Many
apologies if I'm doing something obviously stupid, I have *very little*
experience with compiling things on linux.To speed things up I'm doing my attempted compiles on my laptop instead
of our servers, since I can install packages etc as required myself
without having to wait on our tech support team. I want to verify that I
can get repmgr up and running on as minimal a test server as I can
before rolling it out to slightly more hefty boxes :)I'm running ubuntu server 17.04. The EnterpriseDB installer was used to
quickly install a quick test PostgreSQL db, "testdb" under owning userid
"testdb". Here is the output of pg_config:
Already installed for 9.6 - had to install it for pg_config.
That could be a problem as that is what the make is using below. That
means it is working on the DEB installed locations not the EDB ones. You
sure there is not a pg_config in the EDB install?
So I've already got installed the packages that PACKAGES.MD recommends,
I guess. Attempts to compile repmgr are now failing with:(In the directory with the expanded tar file):
testdb@repm:/postgresql/software/repmgr/repmgr-3.3.1$ sudo make
USE_PGXS=1 install
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv
-fexcess-precision=standard -g -g -O2
-fdebug-prefix-map=/build/postgresql-9.6-jQU1kx/postgresql-9.6-9.6.2=.
-fstack-protector-strong -Wformat -Werror=format-security
-I/usr/include/mit-krb5 -fPIC -pie -fno-omit-frame-pointer
-I/usr/include/postgresql -I. -I./ -I/usr/include/postgresql/9.6/server
-I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2
-D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/tcl8.6 -c -o
dbutils.o dbutils.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv
-fexcess-precision=standard -g -g -O2
-fdebug-prefix-map=/build/postgresql-9.6-jQU1kx/postgresql-9.6-9.6.2=.
-fstack-protector-strong -Wformat -Werror=format-security
-I/usr/include/mit-krb5 -fPIC -pie -fno-omit-frame-pointer
-I/usr/include/postgresql -I. -I./ -I/usr/include/postgresql/9.6/server
-I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2
-D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/tcl8.6 -c -o
config.o config.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv
-fexcess-precision=standard -g -g -O2
-fdebug-prefix-map=/build/postgresql-9.6-jQU1kx/postgresql-9.6-9.6.2=.
-fstack-protector-strong -Wformat -Werror=format-security
-I/usr/include/mit-krb5 -fPIC -pie -fno-omit-frame-pointer
-I/usr/include/postgresql -I. -I./ -I/usr/include/postgresql/9.6/server
-I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2
-D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/tcl8.6 -c -o
repmgrd.o repmgrd.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv
-fexcess-precision=standard -g -g -O2
-fdebug-prefix-map=/build/postgresql-9.6-jQU1kx/postgresql-9.6-9.6.2=.
-fstack-protector-strong -Wformat -Werror=format-security
-I/usr/include/mit-krb5 -fPIC -pie -fno-omit-frame-pointer
-I/usr/include/postgresql -I. -I./ -I/usr/include/postgresql/9.6/server
-I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2
-D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/tcl8.6 -c -o log.o
log.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv
-fexcess-precision=standard -g -g -O2
-fdebug-prefix-map=/build/postgresql-9.6-jQU1kx/postgresql-9.6-9.6.2=.
-fstack-protector-strong -Wformat -Werror=format-security
-I/usr/include/mit-krb5 -fPIC -pie -fno-omit-frame-pointer
-I/usr/include/postgresql -I. -I./ -I/usr/include/postgresql/9.6/server
-I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2
-D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/tcl8.6 -c -o
strutil.o strutil.c
gcc -o repmgrd -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv
-fexcess-precision=standard -g -g -O2
-fdebug-prefix-map=/build/postgresql-9.6-jQU1kx/postgresql-9.6-9.6.2=.
-fstack-protector-strong -Wformat -Werror=format-security
-I/usr/include/mit-krb5 -fPIC -pie -fno-omit-frame-pointer dbutils.o
config.o repmgrd.o log.o strutil.o -L/usr/lib/x86_64-linux-gnu
-lpgcommon -lpgport -L/usr/lib/x86_64-linux-gnu -lpq
-L/usr/lib/x86_64-linux-gnu -Wl,-Bsymbolic-functions -Wl,-z,relro
-Wl,-z,now -Wl,--as-needed -L/usr/lib/mit-krb5
-L/usr/lib/x86_64-linux-gnu/mit-krb5 -Wl,--as-needed -lpgcommon
-lpgport -lselinux -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz
-ledit -lrt -lcrypt -ldl -lm
/usr/bin/ld: cannot find -lselinux
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
/usr/bin/ld: cannot find -lgssapi_krb5
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
Makefile:20: recipe for target 'repmgrd' failed
make: *** [repmgrd] Error 1
Well in the above /usr/include/postgresql/9.6/server is pointing at the
DEB installed directory. Pretty sure I remember that is not where the
EDB installed files are. If you want to compile against the EDB install
you will need to find its pg_config, that is what drives the make
process. If you do find it, then you can do something like this(borrowed
form pglogical):
PATH=<path to EDB pg_config>:$PATH make USE_PGXS=1 clean all
sudo PATH+<path to EDB pg_config>:$PATH make USE_PGXS=1 install
Any ideas what I am doing wrong? I can only assume I'm missing something
really, really, obvious. Every single book and article I've seen simply
states 'Just quickly install repmgr then ...' - it's driving me nuts
that I can't get this thing installed, let alone working :)Any help/advice/suggestions/pointing-outs-of-the-obvious would be
greatly appreciated.Regards,
Martin.
--
Martin Goodson"Have you thought up some clever plan, Doctor?"
"Yes, Jamie, I believe I have."
"What're you going to do?"
"Bung a rock at it."
--
Adrian Klaver
adrian.klaver@aklaver.com
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
On 05/12/2017 08:30 AM, Martin Goodson wrote:
On 12/05/2017 16:18, Joshua D. Drake wrote:
Thanks for the response. The problem is I'm kind of stuck with using
EnterpriseDB's community edition installers. It's a company policy. I
can't install PostgreSQL using repositories, I ** have ** to use the
'Universal Installer' from EnterpriseDB.Surely there must be a way to build repmgr for, and integrate it into, a
PostgreSQL db cluster built using EnterpriseDB? Am I really somehow
running up against a hard limit or am I simply missing something?
To follow up. If information in this post is still correct:
/messages/by-id/CAG7mmozd7VAtdGLyE8pMaxu2KRmJxNTvLTyA0N92nEhXZ4k6hQ@mail.gmail.com
the EDB pg_config should be in:
/opt/PostgreSQL/<version_number>/bin/
Regards,
Martin.
--
Adrian Klaver
adrian.klaver@aklaver.com
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
On 05/12/2017 08:30 AM, Martin Goodson wrote:
On 12/05/2017 16:18, Joshua D. Drake wrote:
On 05/12/2017 08:13 AM, Martin Goodson wrote:
Hello.
Thanks for the response. The problem is I'm kind of stuck with using
EnterpriseDB's community edition installers. It's a company policy. I
can't install PostgreSQL using repositories, I ** have ** to use the
'Universal Installer' from EnterpriseDB.Surely there must be a way to build repmgr for, and integrate it into, a
PostgreSQL db cluster built using EnterpriseDB? Am I really somehow
running up against a hard limit or am I simply missing something?
Follow up to the follow up:
Configuring Automatic failover using Replication Manager 2.0 on
PostgreSQL 9.3.5
http://raghavt.blogspot.com/2015/01/configuring-automatic-failover-using.html
"In this post, am demonstrating Replication Manager on single
node(localhost) on RHEL 6.5 - PostgreSQL 9.3.5. In order to achieve an
easy and good understanding of concept I have compiled repmgr with
EnterpriseDB One Click Installer(a pre-build binary package) instead of
PG source."
Regards,
Martin.
--
Adrian Klaver
adrian.klaver@aklaver.com
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
On 12/05/2017 16:48, Adrian Klaver wrote:
On 05/12/2017 08:30 AM, Martin Goodson wrote:
On 12/05/2017 16:18, Joshua D. Drake wrote:
Thanks for the response. The problem is I'm kind of stuck with using
EnterpriseDB's community edition installers. It's a company policy. I
can't install PostgreSQL using repositories, I ** have ** to use the
'Universal Installer' from EnterpriseDB.Surely there must be a way to build repmgr for, and integrate it
into, a PostgreSQL db cluster built using EnterpriseDB? Am I really
somehow running up against a hard limit or am I simply missing
something?To follow up. If information in this post is still correct:
/messages/by-id/CAG7mmozd7VAtdGLyE8pMaxu2KRmJxNTvLTyA0N92nEhXZ4k6hQ@mail.gmail.com
the EDB pg_config should be in:
/opt/PostgreSQL/<version_number>/bin/
The EDB installer allows you to specify where to install PostgreSQL, and
uses /opt/PostgreSQL/<version> for the default. So yeah, mostly :)
My PATH is this:
/postgresql/software/pg/9.6.2/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin
So it should already be picking up the EDB pg_config :)
For comparison purposes, here's pg_config when run from the cluster
owner (testdb), which should pick up pg_config from the EnterpriseDB
settings:
(testdb@repm:/postgresql/software/repmgr/repmgr-3.3.1$ type pg_config
pg_config is /postgresql/software/pg/9.6.2/bin/pg_config)
BINDIR = /postgresql/software/pg/9.6.2/bin
DOCDIR = /postgresql/software/pg/9.6.2/doc/postgresql
HTMLDIR = /postgresql/software/pg/9.6.2/doc/postgresql
INCLUDEDIR = /postgresql/software/pg/9.6.2/include
PKGINCLUDEDIR = /postgresql/software/pg/9.6.2/include/postgresql
INCLUDEDIR-SERVER = /postgresql/software/pg/9.6.2/include/postgresql/server
LIBDIR = /postgresql/software/pg/9.6.2/lib
PKGLIBDIR = /postgresql/software/pg/9.6.2/lib/postgresql
LOCALEDIR = /postgresql/software/pg/9.6.2/share/locale
MANDIR = /postgresql/software/pg/9.6.2/share/man
SHAREDIR = /postgresql/software/pg/9.6.2/share/postgresql
SYSCONFDIR = /postgresql/software/pg/9.6.2/etc/postgresql
PGXS =
/postgresql/software/pg/9.6.2/lib/postgresql/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--enable-debug' '--with-libs=/opt/local/Current/lib'
'--with-includes=/opt/local/Current/include/libxml2:/opt/local/Current/include'
'--prefix=/mnt/hgfs/pginstaller.auto/server/staging/linux-x64'
'--with-ldap' '--with-openssl' '--with-perl' '--with-python'
'--with-tcl'
'--with-tclconfig=/opt/local/EnterpriseDB/LanguagePack/9.6/Tcl-8.5/lib'
'--with-pam' '--enable-thread-safety' '--with-libxml' '--with-ossp-uuid'
'--docdir=/mnt/hgfs/pginstaller.auto/server/staging/linux-x64/doc/postgresql'
'--with-libxslt' '--with-libedit-preferred' '--with-gssapi'
'LD_LIBRARY_PATH=/opt/local/Current/lib' 'CFLAGS=-O2 -DMAP_HUGETLB=0x40000'
CC = gcc
CPPFLAGS = -DFRONTEND -D_GNU_SOURCE -I/opt/local/Current/include/libxml2
-I/opt/local/Current/include
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -g -O2 -DMAP_HUGETLB=0x40000
CFLAGS_SL = -fpic
LDFLAGS = -L../../src/common -L/opt/local/Current/lib -Wl,--as-needed
-Wl,-rpath,'/mnt/hgfs/pginstaller.auto/server/staging/linux-x64/lib',--enable-new-dtags
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lxslt -lxml2 -lpam -lssl -lcrypto
-lgssapi_krb5 -lz -ledit -lrt -lcrypt -ldl -lm
VERSION = PostgreSQL 9.6.2
And THIS is the output of pg_config when run from another user:
(master@repm:~/repmgr-3.3.1$ type pg_config
pg_config is hashed (/usr/bin/pg_config) )
BINDIR = /usr/lib/postgresql/9.6/bin
DOCDIR = /usr/share/doc/postgresql-doc-9.6
HTMLDIR = /usr/share/doc/postgresql-doc-9.6
INCLUDEDIR = /usr/include/postgresql
PKGINCLUDEDIR = /usr/include/postgresql
INCLUDEDIR-SERVER = /usr/include/postgresql/9.6/server
LIBDIR = /usr/lib/x86_64-linux-gnu
PKGLIBDIR = /usr/lib/postgresql/9.6/lib
LOCALEDIR = /usr/share/locale
MANDIR = /usr/share/postgresql/9.6/man
SHAREDIR = /usr/share/postgresql/9.6
SYSCONFDIR = /etc/postgresql-common
PGXS = /usr/lib/postgresql/9.6/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--with-tcl' '--with-perl' '--with-python' '--with-pam'
'--with-openssl' '--with-libxml' '--with-libxslt'
'--with-tclconfig=/usr/lib/x86_64-linux-gnu/tcl8.6'
'--with-includes=/usr/include/tcl8.6' 'PYTHON=/usr/bin/python'
'--mandir=/usr/share/postgresql/9.6/man'
'--docdir=/usr/share/doc/postgresql-doc-9.6'
'--sysconfdir=/etc/postgresql-common' '--datarootdir=/usr/share/'
'--datadir=/usr/share/postgresql/9.6'
'--bindir=/usr/lib/postgresql/9.6/bin'
'--libdir=/usr/lib/x86_64-linux-gnu/'
'--libexecdir=/usr/lib/postgresql/'
'--includedir=/usr/include/postgresql/' '--enable-nls'
'--enable-integer-datetimes' '--enable-thread-safety'
'--enable-tap-tests' '--enable-debug' '--disable-rpath'
'--with-uuid=e2fs' '--with-gnu-ld' '--with-pgport=5432'
'--with-system-tzdata=/usr/share/zoneinfo' '--with-systemd' 'CFLAGS=-g
-O2 -fstack-protector-strong -Wformat -Werror=format-security
-I/usr/include/mit-krb5 -fPIC -pie -fno-omit-frame-pointer'
'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now
-Wl,--as-needed -L/usr/lib/mit-krb5
-L/usr/lib/x86_64-linux-gnu/mit-krb5' '--with-krb5' '--with-gssapi'
'--with-ldap' '--with-selinux' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2'
CC = gcc
CPPFLAGS = -DFRONTEND -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE
-I/usr/include/libxml2 -I/usr/include/tcl8.6
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv
-fexcess-precision=standard -g -g -O2 -fstack-protector-strong -Wformat
-Werror=format-security -I/usr/include/mit-krb5 -fPIC -pie
-fno-omit-frame-pointer
CFLAGS_SL = -fpic
LDFLAGS = -L../../src/common -Wl,-Bsymbolic-functions -Wl,-z,relro
-Wl,-z,now -Wl,--as-needed -L/usr/lib/mit-krb5
-L/usr/lib/x86_64-linux-gnu/mit-krb5 -Wl,--as-needed
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lselinux -lxslt -lxml2 -lpam -lssl -lcrypto
-lgssapi_krb5 -lz -ledit -lrt -lcrypt -ldl -lm
VERSION = PostgreSQL 9.6.2
'Standard' : LIBS = -lpgcommon -lpgport -lxslt -lxml2 -lpam -lssl
-lcrypto -lgssapi_krb5 -lz -ledit -lrt -lcrypt -ldl -lm
EnterpriseDB: LIBS = -lpgcommon -lpgport -lselinux -lxslt -lxml2 -lpam
-lssl -lcrypto -lgssapi_krb5 -lz -ledit -lrt -lcrypt -ldl -lm
Should I have to somehow override any of that? Surely, if EnterpriseDB
was built with the libs it specifies there I should be able to reference
them?
Current output is:
testdb@repm:/postgresql/software/repmgr/repmgr-3.3.1$ sudo make
USE_PGXS=1 install
gcc -o repmgrd -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv
-fexcess-precision=standard -g -g -O2
-fdebug-prefix-map=/build/postgresql-9.6-jQU1kx/postgresql-9.6-9.6.2=.
-fstack-protector-strong -Wformat -Werror=format-security
-I/usr/include/mit-krb5 -fPIC -pie -fno-omit-frame-pointer dbutils.o
config.o repmgrd.o log.o strutil.o -L/usr/lib/x86_64-linux-gnu
-lpgcommon -lpgport -L/usr/lib/x86_64-linux-gnu -lpq
-L/usr/lib/x86_64-linux-gnu -Wl,-Bsymbolic-functions -Wl,-z,relro
-Wl,-z,now -Wl,--as-needed -L/usr/lib/mit-krb5
-L/usr/lib/x86_64-linux-gnu/mit-krb5 -Wl,--as-needed -lpgcommon
-lpgport -lselinux -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz
-ledit -lrt -lcrypt -ldl -lm
/usr/bin/ld: cannot find -lselinux
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
/usr/bin/ld: cannot find -lgssapi_krb5
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
Makefile:20: recipe for target 'repmgrd' failed
make: *** [repmgrd] Error 1
As mentioned : I don't have much experience with compiling on linux, so
I may be missing something horribly obvious :)
Martin.
--
Martin Goodson
"Have you thought up some clever plan, Doctor?"
"Yes, Jamie, I believe I have."
"What're you going to do?"
"Bung a rock at it."
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
On 12/05/2017 16:59, Adrian Klaver wrote:
Configuring Automatic failover using Replication Manager 2.0 on
PostgreSQL 9.3.5http://raghavt.blogspot.com/2015/01/configuring-automatic-failover-using.html
"In this post, am demonstrating Replication Manager on single
node(localhost) on RHEL 6.5 - PostgreSQL 9.3.5. In order to achieve an
easy and good understanding of concept I have compiled repmgr with
EnterpriseDB One Click Installer(a pre-build binary package) instead
of PG source."
Looks interesting! I'll give it a go tonight on a clean install and
report back on how easy it was and how much of an idiot I am, or my
abject failure and how much of an idiot I am :)
Many thanks!
Regards,
Martin.
--
Martin Goodson
"Have you thought up some clever plan, Doctor?"
"Yes, Jamie, I believe I have."
"What're you going to do?"
"Bung a rock at it."
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
On 05/12/2017 09:14 AM, Martin Goodson wrote:
On 12/05/2017 16:48, Adrian Klaver wrote:
On 05/12/2017 08:30 AM, Martin Goodson wrote:
On 12/05/2017 16:18, Joshua D. Drake wrote:
The EDB installer allows you to specify where to install PostgreSQL, and
uses /opt/PostgreSQL/<version> for the default. So yeah, mostly :)My PATH is this:
/postgresql/software/pg/9.6.2/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/binSo it should already be picking up the EDB pg_config :)
Just to be clear you changed the default install location to
/postgresql/software/pg/9.6.2, correct?
For comparison purposes, here's pg_config when run from the cluster
owner (testdb), which should pick up pg_config from the EnterpriseDB
settings:(testdb@repm:/postgresql/software/repmgr/repmgr-3.3.1$ type pg_config
Alright that is the EDB pg_config.
And THIS is the output of pg_config when run from another user:
(master@repm:~/repmgr-3.3.1$ type pg_config
pg_config is hashed (/usr/bin/pg_config) )
The Ubuntu/Debian packages.
Should I have to somehow override any of that? Surely, if EnterpriseDB
was built with the libs it specifies there I should be able to reference
them?Current output is:
testdb@repm:/postgresql/software/repmgr/repmgr-3.3.1$ sudo make
USE_PGXS=1 install
Note the sudo, that changes you into a new environment that is not
seeing your $PATH:
/postgresql/software/pg/9.6.2/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin
Hence my previous suggestion(***CORRECTED***):
PATH=<path to EDB pg_config>:$PATH make USE_PGXS=1 clean all
sudo PATH=<path to EDB pg_config>:$PATH make USE_PGXS=1 install
It is broken down into two steps, so the first step will clean up any
previous attempts before going forward.
As mentioned : I don't have much experience with compiling on linux, so
I may be missing something horribly obvious :)Martin.
--
Adrian Klaver
adrian.klaver@aklaver.com
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
On 05/12/2017 09:19 AM, Martin Goodson wrote:
On 12/05/2017 16:59, Adrian Klaver wrote:
Configuring Automatic failover using Replication Manager 2.0 on
PostgreSQL 9.3.5http://raghavt.blogspot.com/2015/01/configuring-automatic-failover-using.html
"In this post, am demonstrating Replication Manager on single
node(localhost) on RHEL 6.5 - PostgreSQL 9.3.5. In order to achieve an
easy and good understanding of concept I have compiled repmgr with
EnterpriseDB One Click Installer(a pre-build binary package) instead
of PG source."Looks interesting! I'll give it a go tonight on a clean install and
report back on how easy it was and how much of an idiot I am, or my
abject failure and how much of an idiot I am :)
To make things easier I would remove the deb installed Postgres, it just
adds complexity to the situation without providing benefit.
Many thanks!
Regards,
Martin.
--
Adrian Klaver
adrian.klaver@aklaver.com
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
On 12/05/2017 18:57, Adrian Klaver wrote:
On 05/12/2017 09:19 AM, Martin Goodson wrote:
On 12/05/2017 16:59, Adrian Klaver wrote:
Configuring Automatic failover using Replication Manager 2.0 on
PostgreSQL 9.3.5http://raghavt.blogspot.com/2015/01/configuring-automatic-failover-using.html
"In this post, am demonstrating Replication Manager on single
node(localhost) on RHEL 6.5 - PostgreSQL 9.3.5. In order to achieve
an easy and good understanding of concept I have compiled repmgr
with EnterpriseDB One Click Installer(a pre-build binary package)
instead of PG source."Looks interesting! I'll give it a go tonight on a clean install and
report back on how easy it was and how much of an idiot I am, or my
abject failure and how much of an idiot I am :)To make things easier I would remove the deb installed Postgres, it
just adds complexity to the situation without providing benefit.Many thanks!
Regards,
Martin.
Progress of a sort. Kinda.
On a clean Ubuntu server 17.04 virtual machine I've installed PostgreSQL
9.6 using the EnterpriseDB installer. The software was installed by
sudo'ing the installer, configuring ownership to the 'pginst' userid and
is up and running :
pginst 2582 1 0 09:22 ? 00:00:00
/postgresql/software/9.6.2/bin/postgres -D /postgresql/software/9.6.2/data
pginst 2585 2582 0 09:22 ? 00:00:00 postgres: logger process
pginst 2587 2582 0 09:22 ? 00:00:00 postgres: checkpointer
process
pginst 2588 2582 0 09:22 ? 00:00:00 postgres: writer process
pginst 2589 2582 0 09:22 ? 00:00:00 postgres: wal writer process
pginst 2590 2582 0 09:22 ? 00:00:00 postgres: autovacuum
launcher process
pginst 2591 2582 0 09:22 ? 00:00:00 postgres: stats
collector process
I then downloaded the repmgr package (repmgr-3.3.1.tar.gz) from 2nd
quadrant, unzipped and untarred etc to the directory
/home/master/repmgr-3.3.1. I've followed the advice of the article
Adrian suggested and installed some packages:
gcc, make, libxslt1-dev, libpam0g-dev, libssl-dev, libkrb5-dev,
libedit-dev, postgresql-server-dev-9.6
I have now apparently resolved the missing libraries problem. Or, at
least, it's no longer complaining that libs are missing.
I built a little install script which I sudo:
clear
PATH=/postgresql/software/9.6.2/bin:$PATH
echo "PATH = $PATH"
echo ""
pg_config
echo ""
echo "make USE_PGXS=1 clean all"
echo ""
make USE_PGXS=1 clean all
Which produces this output (including the output of pg_config):
PATH =
/postgresql/software/9.6.2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
BINDIR = /postgresql/software/9.6.2/bin
DOCDIR = /postgresql/software/9.6.2/doc/postgresql
HTMLDIR = /postgresql/software/9.6.2/doc/postgresql
INCLUDEDIR = /postgresql/software/9.6.2/include
PKGINCLUDEDIR = /postgresql/software/9.6.2/include/postgresql
INCLUDEDIR-SERVER = /postgresql/software/9.6.2/include/postgresql/server
LIBDIR = /postgresql/software/9.6.2/lib
PKGLIBDIR = /postgresql/software/9.6.2/lib/postgresql
LOCALEDIR = /postgresql/software/9.6.2/share/locale
MANDIR = /postgresql/software/9.6.2/share/man
SHAREDIR = /postgresql/software/9.6.2/share/postgresql
SYSCONFDIR = /postgresql/software/9.6.2/etc/postgresql
PGXS = /postgresql/software/9.6.2/lib/postgresql/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--enable-debug' '--with-libs=/opt/local/Current/lib'
'--with-includes=/opt/local/Current/include/libxml2:/opt/local/Current/include'
'--prefix=/mnt/hgfs/pginstaller.auto/server/staging/linux-x64'
'--with-ldap' '--with-openssl' '--with-perl' '--with-python'
'--with-tcl'
'--with-tclconfig=/opt/local/EnterpriseDB/LanguagePack/9.6/Tcl-8.5/lib'
'--with-pam' '--enable-thread-safety' '--with-libxml' '--with-ossp-uuid'
'--docdir=/mnt/hgfs/pginstaller.auto/server/staging/linux-x64/doc/postgresql'
'--with-libxslt' '--with-libedit-preferred' '--with-gssapi'
'LD_LIBRARY_PATH=/opt/local/Current/lib' 'CFLAGS=-O2 -DMAP_HUGETLB=0x40000'
CC = gcc
CPPFLAGS = -DFRONTEND -D_GNU_SOURCE -I/opt/local/Current/include/libxml2
-I/opt/local/Current/include
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -g -O2 -DMAP_HUGETLB=0x40000
CFLAGS_SL = -fpic
LDFLAGS = -L../../src/common -L/opt/local/Current/lib -Wl,--as-needed
-Wl,-rpath,'/mnt/hgfs/pginstaller.auto/server/staging/linux-x64/lib',--enable-new-dtags
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lxslt -lxml2 -lpam -lssl -lcrypto
-lgssapi_krb5 -lz -ledit -lrt -lcrypt -ldl -lm
VERSION = PostgreSQL 9.6.2
make USE_PGXS=1 clean all
rm -f *.o
rm -f repmgrd
rm -f repmgr
make -C sql clean
make[1]: Entering directory '/home/master/repmgr-3.3.1/sql'
rm -f repmgr_funcs.so librepmgr_funcs.a librepmgr_funcs.pc
rm -f repmgr_funcs.sql
rm -f repmgr_funcs.o
make[1]: Leaving directory '/home/master/repmgr-3.3.1/sql'
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -g -O2
-DMAP_HUGETLB=0x40000 -I/postgresql/software/9.6.2/include -I. -I./
-I/postgresql/software/9.6.2/include/postgresql/server
-I/postgresql/software/9.6.2/include/postgresql/internal -D_GNU_SOURCE
-I/opt/local/Current/include/libxml2 -I/opt/local/Current/include -c -o
dbutils.o dbutils.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -g -O2
-DMAP_HUGETLB=0x40000 -I/postgresql/software/9.6.2/include -I. -I./
-I/postgresql/software/9.6.2/include/postgresql/server
-I/postgresql/software/9.6.2/include/postgresql/internal -D_GNU_SOURCE
-I/opt/local/Current/include/libxml2 -I/opt/local/Current/include -c -o
config.o config.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -g -O2
-DMAP_HUGETLB=0x40000 -I/postgresql/software/9.6.2/include -I. -I./
-I/postgresql/software/9.6.2/include/postgresql/server
-I/postgresql/software/9.6.2/include/postgresql/internal -D_GNU_SOURCE
-I/opt/local/Current/include/libxml2 -I/opt/local/Current/include -c -o
repmgrd.o repmgrd.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -g -O2
-DMAP_HUGETLB=0x40000 -I/postgresql/software/9.6.2/include -I. -I./
-I/postgresql/software/9.6.2/include/postgresql/server
-I/postgresql/software/9.6.2/include/postgresql/internal -D_GNU_SOURCE
-I/opt/local/Current/include/libxml2 -I/opt/local/Current/include -c -o
log.o log.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -g -O2
-DMAP_HUGETLB=0x40000 -I/postgresql/software/9.6.2/include -I. -I./
-I/postgresql/software/9.6.2/include/postgresql/server
-I/postgresql/software/9.6.2/include/postgresql/internal -D_GNU_SOURCE
-I/opt/local/Current/include/libxml2 -I/opt/local/Current/include -c -o
strutil.o strutil.c
gcc -o repmgrd -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -g -O2
-DMAP_HUGETLB=0x40000 dbutils.o config.o repmgrd.o log.o strutil.o
-L/postgresql/software/9.6.2/lib -lpgcommon -lpgport
-L/postgresql/software/9.6.2/lib -lpq -L/postgresql/software/9.6.2/lib
-L/opt/local/Current/lib -Wl,--as-needed
-Wl,-rpath,'/postgresql/software/9.6.2/lib',--enable-new-dtags
-lpgcommon -lpgport -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz
-ledit -lrt -lcrypt -ldl -lm
/usr/bin/ld: /postgresql/software/9.6.2/lib/libpgcommon.a(exec.o):
relocation R_X86_64_32 against `.rodata.str1.1' can not be used when
making a shared object; recompile with -fPIC
/usr/bin/ld: /postgresql/software/9.6.2/lib/libpgcommon.a(wait_error.o):
relocation R_X86_64_32 against `.rodata.str1.8' can not be used when
making a shared object; recompile with -fPIC
/usr/bin/ld:
/postgresql/software/9.6.2/lib/libpgcommon.a(fe_memutils.o): relocation
R_X86_64_32 against `.rodata.str1.1' can not be used when making a
shared object; recompile with -fPIC
/usr/bin/ld: /postgresql/software/9.6.2/lib/libpgport.a(path.o):
relocation R_X86_64_32 against `.rodata.str1.1' can not be used when
making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile:20: recipe for target 'repmgrd' failed
make: *** [repmgrd] Error 1
This is getting rather frustrating :)
Any suggestions, anyone? Is this another obvious thing that crops up
when compiling anything in PostgreSQL? Or have I hit an 'issue'?
Regards,
Martin.
--
Martin Goodson
"Have you thought up some clever plan, Doctor?"
"Yes, Jamie, I believe I have."
"What're you going to do?"
"Bung a rock at it."
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
On 05/14/2017 02:43 AM, Martin Goodson wrote:
On 12/05/2017 18:57, Adrian Klaver wrote:
On 05/12/2017 09:19 AM, Martin Goodson wrote:
On 12/05/2017 16:59, Adrian Klaver wrote:
Progress of a sort. Kinda.
On a clean Ubuntu server 17.04 virtual machine I've installed PostgreSQL
9.6 using the EnterpriseDB installer. The software was installed by
sudo'ing the installer, configuring ownership to the 'pginst' userid and
is up and running :
I then downloaded the repmgr package (repmgr-3.3.1.tar.gz) from 2nd
quadrant, unzipped and untarred etc to the directory
/home/master/repmgr-3.3.1. I've followed the advice of the article
Adrian suggested and installed some packages:gcc, make, libxslt1-dev, libpam0g-dev, libssl-dev, libkrb5-dev,
libedit-dev, postgresql-server-dev-9.6I have now apparently resolved the missing libraries problem. Or, at
least, it's no longer complaining that libs are missing.I built a little install script which I sudo:
clear
PATH=/postgresql/software/9.6.2/bin:$PATH
You forgot a step:
export LD_LIBRARY_PATH=/postgresql/software/9.6.2/lib:$LD_LIBRARY_PATH
echo "PATH = $PATH"
echo ""
pg_config
echo ""
echo "make USE_PGXS=1 clean all"
echo ""
make USE_PGXS=1 clean allWhich produces this output (including the output of pg_config):
PATH =
/postgresql/software/9.6.2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/binBINDIR = /postgresql/software/9.6.2/bin
DOCDIR = /postgresql/software/9.6.2/doc/postgresql
HTMLDIR = /postgresql/software/9.6.2/doc/postgresql
INCLUDEDIR = /postgresql/software/9.6.2/include
PKGINCLUDEDIR = /postgresql/software/9.6.2/include/postgresql
INCLUDEDIR-SERVER = /postgresql/software/9.6.2/include/postgresql/server
LIBDIR = /postgresql/software/9.6.2/lib
PKGLIBDIR = /postgresql/software/9.6.2/lib/postgresql
LOCALEDIR = /postgresql/software/9.6.2/share/locale
MANDIR = /postgresql/software/9.6.2/share/man
SHAREDIR = /postgresql/software/9.6.2/share/postgresql
SYSCONFDIR = /postgresql/software/9.6.2/etc/postgresql
PGXS = /postgresql/software/9.6.2/lib/postgresql/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--enable-debug' '--with-libs=/opt/local/Current/lib'
'--with-includes=/opt/local/Current/include/libxml2:/opt/local/Current/include'
'--prefix=/mnt/hgfs/pginstaller.auto/server/staging/linux-x64'
'--with-ldap' '--with-openssl' '--with-perl' '--with-python'
'--with-tcl'
'--with-tclconfig=/opt/local/EnterpriseDB/LanguagePack/9.6/Tcl-8.5/lib'
'--with-pam' '--enable-thread-safety' '--with-libxml' '--with-ossp-uuid'
'--docdir=/mnt/hgfs/pginstaller.auto/server/staging/linux-x64/doc/postgresql'
'--with-libxslt' '--with-libedit-preferred' '--with-gssapi'
'LD_LIBRARY_PATH=/opt/local/Current/lib' 'CFLAGS=-O2 -DMAP_HUGETLB=0x40000'
CC = gcc
CPPFLAGS = -DFRONTEND -D_GNU_SOURCE -I/opt/local/Current/include/libxml2
-I/opt/local/Current/include
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -g -O2 -DMAP_HUGETLB=0x40000
CFLAGS_SL = -fpic
LDFLAGS = -L../../src/common -L/opt/local/Current/lib -Wl,--as-needed
-Wl,-rpath,'/mnt/hgfs/pginstaller.auto/server/staging/linux-x64/lib',--enable-new-dtagsLDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lxslt -lxml2 -lpam -lssl -lcrypto
-lgssapi_krb5 -lz -ledit -lrt -lcrypt -ldl -lm
VERSION = PostgreSQL 9.6.2make USE_PGXS=1 clean all
rm -f *.o
rm -f repmgrd
rm -f repmgr
make -C sql clean
make[1]: Entering directory '/home/master/repmgr-3.3.1/sql'
rm -f repmgr_funcs.so librepmgr_funcs.a librepmgr_funcs.pc
rm -f repmgr_funcs.sql
rm -f repmgr_funcs.o
make[1]: Leaving directory '/home/master/repmgr-3.3.1/sql'
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -g -O2
-DMAP_HUGETLB=0x40000 -I/postgresql/software/9.6.2/include -I. -I./
-I/postgresql/software/9.6.2/include/postgresql/server
-I/postgresql/software/9.6.2/include/postgresql/internal -D_GNU_SOURCE
-I/opt/local/Current/include/libxml2 -I/opt/local/Current/include -c -o
dbutils.o dbutils.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -g -O2
-DMAP_HUGETLB=0x40000 -I/postgresql/software/9.6.2/include -I. -I./
-I/postgresql/software/9.6.2/include/postgresql/server
-I/postgresql/software/9.6.2/include/postgresql/internal -D_GNU_SOURCE
-I/opt/local/Current/include/libxml2 -I/opt/local/Current/include -c -o
config.o config.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -g -O2
-DMAP_HUGETLB=0x40000 -I/postgresql/software/9.6.2/include -I. -I./
-I/postgresql/software/9.6.2/include/postgresql/server
-I/postgresql/software/9.6.2/include/postgresql/internal -D_GNU_SOURCE
-I/opt/local/Current/include/libxml2 -I/opt/local/Current/include -c -o
repmgrd.o repmgrd.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -g -O2
-DMAP_HUGETLB=0x40000 -I/postgresql/software/9.6.2/include -I. -I./
-I/postgresql/software/9.6.2/include/postgresql/server
-I/postgresql/software/9.6.2/include/postgresql/internal -D_GNU_SOURCE
-I/opt/local/Current/include/libxml2 -I/opt/local/Current/include -c -o
log.o log.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -g -O2
-DMAP_HUGETLB=0x40000 -I/postgresql/software/9.6.2/include -I. -I./
-I/postgresql/software/9.6.2/include/postgresql/server
-I/postgresql/software/9.6.2/include/postgresql/internal -D_GNU_SOURCE
-I/opt/local/Current/include/libxml2 -I/opt/local/Current/include -c -o
strutil.o strutil.c
gcc -o repmgrd -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -g -O2
-DMAP_HUGETLB=0x40000 dbutils.o config.o repmgrd.o log.o strutil.o
-L/postgresql/software/9.6.2/lib -lpgcommon -lpgport
-L/postgresql/software/9.6.2/lib -lpq -L/postgresql/software/9.6.2/lib
-L/opt/local/Current/lib -Wl,--as-needed
-Wl,-rpath,'/postgresql/software/9.6.2/lib',--enable-new-dtags
-lpgcommon -lpgport -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz
-ledit -lrt -lcrypt -ldl -lm
/usr/bin/ld: /postgresql/software/9.6.2/lib/libpgcommon.a(exec.o):
relocation R_X86_64_32 against `.rodata.str1.1' can not be used when
making a shared object; recompile with -fPIC
/usr/bin/ld: /postgresql/software/9.6.2/lib/libpgcommon.a(wait_error.o):
relocation R_X86_64_32 against `.rodata.str1.8' can not be used when
making a shared object; recompile with -fPIC
/usr/bin/ld:
/postgresql/software/9.6.2/lib/libpgcommon.a(fe_memutils.o): relocation
R_X86_64_32 against `.rodata.str1.1' can not be used when making a
shared object; recompile with -fPIC
/usr/bin/ld: /postgresql/software/9.6.2/lib/libpgport.a(path.o):
relocation R_X86_64_32 against `.rodata.str1.1' can not be used when
making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile:20: recipe for target 'repmgrd' failed
make: *** [repmgrd] Error 1This is getting rather frustrating :)
Any suggestions, anyone? Is this another obvious thing that crops up
when compiling anything in PostgreSQL? Or have I hit an 'issue'?Regards,
Martin.
--
Adrian Klaver
adrian.klaver@aklaver.com
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
On 05/14/2017 02:43 AM, Martin Goodson wrote:
On 12/05/2017 18:57, Adrian Klaver wrote:
On 05/12/2017 09:19 AM, Martin Goodson wrote:
On 12/05/2017 16:59, Adrian Klaver wrote:
To make things easier I would remove the deb installed Postgres, it
just adds complexity to the situation without providing benefit.Many thanks!
Regards,
Martin.
Progress of a sort. Kinda.
This is getting rather frustrating :)
I understand. I just installed EDB Postgres 9.6.3 on my openSUSE Leap
42.2 machine and tried to compile repmgr against it. No joy. Seems to be
some sort of library mismatch with krb5. I can compile/install it
against my source installed(www.postgresql.org/ftp/source/) version of
Postgres.
Any suggestions, anyone? Is this another obvious thing that crops up
when compiling anything in PostgreSQL? Or have I hit an 'issue'?
It is a compilation error not specific to Postgres. Remember what you
downloaded is a third party build for a generic platform. I am guessing
you chose Linux X86-64. Best guess is that the libraries that where
compiled by EDB for the build are not an exact match for the libraries
you have on your machine. Someone with more experience will need to
interpret what:
/usr/bin/ld: /postgresql/software/9.6.2/lib/libpgport.a(path.o):
relocation R_X86_64_32 against `.rodata.str1.1' can not be used when
making a shared object; recompile with -fPIC
means?
I used to point folks to the EDB forums when we got to this point. The
EDB website was redesigned and I can't find the forums any more. You
said earlier that your company policy was to use the EDB installer. Does
the company have a support contract that you can use to get answers?
Regards,
Martin.
--
Adrian Klaver
adrian.klaver@aklaver.com
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Hi Josh,
On Fri, 2017-05-12 at 08:18 -0700, Joshua D. Drake wrote:
This is your problem. As Adrian already mentioned, you should be running
the PGDG apt repos.
I don't think this is a productive answer. I could just compile repmgr on my
CentOS 7 box against EPAS 9.6. Someone with a few packaging skills can also
easily build package of repmgr against EPAS.
That said, I'll reply Martin's email, too.
Regards,
--
Devrim Gündüz
EnterpriseDB: http://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR
Hi Martin,
On Fri, 2017-05-12 at 16:13 +0100, Martin Goodson wrote:
/usr/bin/ld: cannot find -lselinux
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
/usr/bin/ld: cannot find -lgssapi_krb5
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
Makefile:20: recipe for target 'repmgrd' failed
make: *** [repmgrd] Error 1
I just tested this on my CentOS 7 box -- FWIW, you need to following
dependencies (these are CentOS/RHEL package names, you can find their Ubuntu
equivalents easily):
systemd
libxslt-devel
pam-devel
openssl-devel
readline-devel
libmemcached-devel
libicu-devel
Once you install their equivalent, you'll be able to compile repmgr against
EPAS 9.6. (Hint: Last time I used Ubuntu/Debian, their package names ended with
-dev for the development packages)
Regards,
--
Devrim Gündüz
EnterpriseDB: http://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR
Hi again Martin,
On Fri, 2017-05-12 at 16:13 +0100, Martin Goodson wrote:
testdb@repm:/postgresql/software/repmgr/repmgr-3.3.1$ sudo make
USE_PGXS=1 install
BTW, please patch these two files first and change
PG_CONFIG = pg_config
to
PG_CONFIG= /postgresql/software/pg/9.6.2/bin/config
(apologies if you did this already, I did not read the whole thread):
Makefile: line 33
sql/Makefile: line 13
and run
USE_PGXS=1 make
at this point.
Regards,
--
Devrim Gündüz
EnterpriseDB: http://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR
Hi Adrian,
On Sun, 2017-05-14 at 09:00 -0700, Adrian Klaver wrote:
I understand. I just installed EDB Postgres 9.6.3 on my openSUSE Leap
42.2 machine and tried to compile repmgr against it. No joy.
We don't support OpenSuSE, that might be the reason.
Regards,
--
Devrim Gündüz
EnterpriseDB: http://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR
On 05/14/2017 11:29 AM, Devrim Gündüz wrote:
Hi again Martin,
On Fri, 2017-05-12 at 16:13 +0100, Martin Goodson wrote:
testdb@repm:/postgresql/software/repmgr/repmgr-3.3.1$ sudo make
USE_PGXS=1 installBTW, please patch these two files first and change
PG_CONFIG = pg_config
to
PG_CONFIG= /postgresql/software/pg/9.6.2/bin/config
Shouldn't the above be:
PG_CONFIG= /postgresql/software/pg/9.6.2/bin/pg_config
At any rate the build was finding the correct pg_config:
"
clear
PATH=/postgresql/software/9.6.2/bin:$PATH
echo "PATH = $PATH"
echo ""
pg_config
echo ""
echo "make USE_PGXS=1 clean all"
echo ""
make USE_PGXS=1 clean all
Which produces this output (including the output of pg_config), from
upstream:
PATH =
/postgresql/software/9.6.2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
BINDIR = /postgresql/software/9.6.2/bin
DOCDIR = /postgresql/software/9.6.2/doc/postgresql
HTMLDIR = /postgresql/software/9.6.2/doc/postgresql
INCLUDEDIR = /postgresql/software/9.6.2/include
PKGINCLUDEDIR = /postgresql/software/9.6.2/include/postgresql
INCLUDEDIR-SERVER = /postgresql/software/9.6.2/include/postgresql/server
LIBDIR = /postgresql/software/9.6.2/lib
PKGLIBDIR = /postgresql/software/9.6.2/lib/postgresql
LOCALEDIR = /postgresql/software/9.6.2/share/locale
MANDIR = /postgresql/software/9.6.2/share/man
SHAREDIR = /postgresql/software/9.6.2/share/postgresql
SYSCONFDIR = /postgresql/software/9.6.2/etc/postgresql
PGXS = /postgresql/software/9.6.2/lib/postgresql/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--enable-debug' '--with-libs=/opt/local/Current/lib'
'--with-includes=/opt/local/Current/include/libxml2:/opt/local/Current/include'
'--prefix=/mnt/hgfs/pginstaller.auto/server/staging/linux-x64'
'--with-ldap' '--with-openssl' '--with-perl' '--with-python'
'--with-tcl'
'--with-tclconfig=/opt/local/EnterpriseDB/LanguagePack/9.6/Tcl-8.5/lib'
'--with-pam' '--enable-thread-safety' '--with-libxml' '--with-ossp-uuid'
'--docdir=/mnt/hgfs/pginstaller.auto/server/staging/linux-x64/doc/postgresql'
'--with-libxslt' '--with-libedit-preferred' '--with-gssapi'
'LD_LIBRARY_PATH=/opt/local/Current/lib' 'CFLAGS=-O2 -DMAP_HUGETLB=0x40000'
CC = gcc
CPPFLAGS = -DFRONTEND -D_GNU_SOURCE -I/opt/local/Current/include/libxml2
-I/opt/local/Current/include
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -g -O2 -DMAP_HUGETLB=0x40000
CFLAGS_SL = -fpic
LDFLAGS = -L../../src/common -L/opt/local/Current/lib -Wl,--as-needed
-Wl,-rpath,'/mnt/hgfs/pginstaller.auto/server/staging/linux-x64/lib',--enable-new-dtags
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lxslt -lxml2 -lpam -lssl -lcrypto
-lgssapi_krb5 -lz -ledit -lrt -lcrypt -ldl -lm
VERSION = PostgreSQL 9.6.2
"
The problem the OP ran into was several errors like this:
/usr/bin/ld: /postgresql/software/9.6.2/lib/libpgport.a(path.o):
relocation R_X86_64_32 against `.rodata.str1.1' can not be used when
making a shared object; recompile with -fPIC
(apologies if you did this already, I did not read the whole thread):
Makefile: line 33
sql/Makefile: line 13and run
USE_PGXS=1 make
at this point.Regards,
--
Adrian Klaver
adrian.klaver@aklaver.com
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
On 05/14/2017 11:31 AM, Devrim Gündüz wrote:
Hi Adrian,
On Sun, 2017-05-14 at 09:00 -0700, Adrian Klaver wrote:
I understand. I just installed EDB Postgres 9.6.3 on my openSUSE Leap
42.2 machine and tried to compile repmgr against it. No joy.We don't support OpenSuSE, that might be the reason.
Who is we and what don't you support?
Regards,
--
Adrian Klaver
adrian.klaver@aklaver.com
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Hi,
On Sun, 2017-05-14 at 12:59 -0700, Adrian Klaver wrote:
We don't support OpenSuSE, that might be the reason.
Who is we
EnterpriseDB.
and what don't you support?
OpenSuSE, as I wrote in the previous email.
Regards,
--
Devrim Gündüz
EnterpriseDB: http://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR