Обсуждение: [GENERAL] Installing repmgr alongside PostgreSQL installed via EnterpriseDBinstaller instead of repositories?

Поиск
Список
Период
Сортировка
Hello. First time poster, so please be gentle :)

I have a PostgreSQL 9.6 database cluster running on a standalone Redhat
7.2 (Maipo) server.

This may seem like a silly question. It probably *is* a silly question,
so apologies in advance.

PostgreSQL was installed using the "EDB Postgres Standard" installer
from EnterpriseDB -
https://www.enterprisedb.com/software-downloads-postgres - and installed
to a specific location - /db_<dbname>.  No repositories, nothing in a
'standard' place.

Output of pg_config is as follows:

BINDIR = /db_dbname/app/postgres/9.6.2-3/bin
DOCDIR = /db_dbname/app/postgres/9.6.2-3/doc/postgresql
HTMLDIR = /db_dbname/app/postgres/9.6.2-3/doc/postgresql
INCLUDEDIR = /db_dbname/app/postgres/9.6.2-3/include
PKGINCLUDEDIR = /db_dbname/app/postgres/9.6.2-3/include/postgresql
INCLUDEDIR-SERVER =
/db_dbname/app/postgres/9.6.2-3/include/postgresql/server
LIBDIR = /db_dbname/app/postgres/9.6.2-3/lib
PKGLIBDIR = /db_dbname/app/postgres/9.6.2-3/lib/postgresql
LOCALEDIR = /db_dbname/app/postgres/9.6.2-3/share/locale
MANDIR = /db_dbname/app/postgres/9.6.2-3/share/man
SHAREDIR = /db_dbname/app/postgres/9.6.2-3/share/postgresql
SYSCONFDIR = /db_dbname/app/postgres/9.6.2-3/etc/postgresql
PGXS =
/db_dbname/app/postgres/9.6.2-3/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

I have now been tasked with putting repmgr onto this box and converting
it from a standalone to a multiple node setup (I have two additional
servers lurking in the background ready for use :) ).

Numerous articles on repmgr all seem to suggest it should be a
relatively simply operation once the software is in place. Register the
master. Clone standbys. Ought to be *relatively* straight-forward.

Unfortunately, I'm having problems at the first hurdle - putting the
software in place. We initially tried installing from the postgres
repository rpm - which insisted, of course, on installing PostgreSQL as
well as repmgr in /usr/pgsql-9.6. Obviously not the right place for it
given we're running our binaries from /db_dbname/app/postgres/9.6.2-3/bin

Is there a simple way to use repmgr from the package, perhaps by
copying/linking files from that location to ours? (e.g. copying/linking
some files from lib, bin, contrib, etc).

Or am I looking at having to compile the source? I'm told it should be
'simple' but I've not compiled much software from scratch on linux, so
I'm a bit nervous about the prospect. Any advice would be welcome :)

Basically, am I going to be stuck compiling from source or is there a
way around this?

Many thanks.

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/11/2017 06:58 AM, Martin Goodson wrote:
> Hello. First time poster, so please be gentle :)
>
> I have a PostgreSQL 9.6 database cluster running on a standalone Redhat
> 7.2 (Maipo) server.
>
> This may seem like a silly question. It probably *is* a silly question,
> so apologies in advance.
>
> PostgreSQL was installed using the "EDB Postgres Standard" installer
> from EnterpriseDB -
> https://www.enterprisedb.com/software-downloads-postgres - and installed
> to a specific location - /db_<dbname>.  No repositories, nothing in a
> 'standard' place.
>
> Output of pg_config is as follows:
>
> BINDIR = /db_dbname/app/postgres/9.6.2-3/bin
> DOCDIR = /db_dbname/app/postgres/9.6.2-3/doc/postgresql
> HTMLDIR = /db_dbname/app/postgres/9.6.2-3/doc/postgresql
> INCLUDEDIR = /db_dbname/app/postgres/9.6.2-3/include
> PKGINCLUDEDIR = /db_dbname/app/postgres/9.6.2-3/include/postgresql
> INCLUDEDIR-SERVER =
> /db_dbname/app/postgres/9.6.2-3/include/postgresql/server
> LIBDIR = /db_dbname/app/postgres/9.6.2-3/lib
> PKGLIBDIR = /db_dbname/app/postgres/9.6.2-3/lib/postgresql
> LOCALEDIR = /db_dbname/app/postgres/9.6.2-3/share/locale
> MANDIR = /db_dbname/app/postgres/9.6.2-3/share/man
> SHAREDIR = /db_dbname/app/postgres/9.6.2-3/share/postgresql
> SYSCONFDIR = /db_dbname/app/postgres/9.6.2-3/etc/postgresql
> PGXS =
> /db_dbname/app/postgres/9.6.2-3/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
>
> I have now been tasked with putting repmgr onto this box and converting
> it from a standalone to a multiple node setup (I have two additional
> servers lurking in the background ready for use :) ).
>
> Numerous articles on repmgr all seem to suggest it should be a
> relatively simply operation once the software is in place. Register the
> master. Clone standbys. Ought to be *relatively* straight-forward.
>
> Unfortunately, I'm having problems at the first hurdle - putting the
> software in place. We initially tried installing from the postgres
> repository rpm - which insisted, of course, on installing PostgreSQL as
> well as repmgr in /usr/pgsql-9.6. Obviously not the right place for it
> given we're running our binaries from /db_dbname/app/postgres/9.6.2-3/bin
>
> Is there a simple way to use repmgr from the package, perhaps by
> copying/linking files from that location to ours? (e.g. copying/linking
> some files from lib, bin, contrib, etc).
>
> Or am I looking at having to compile the source? I'm told it should be
> 'simple' but I've not compiled much software from scratch on linux, so
> I'm a bit nervous about the prospect. Any advice would be welcome :)
>
> Basically, am I going to be stuck compiling from source or is there a
> way around this?

Not sure how deep you are into your present situation. The only thing I
can think of is to install Postgres using the PGDG repos and then
migrating the data from the EDB install to the RPM install. You would
probably have to change the port numbers, at least temporarily, while
you do the migration. This way you could use the packaging system
without resorting to work-arounds.

>
> Many thanks.
>
> Martin.


--
Adrian Klaver
adrian.klaver@aklaver.com



On May 11, 2017, at 10:17 AM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:

On 05/11/2017 06:58 AM, Martin Goodson wrote:
Hello. First time poster, so please be gentle :)
I have a PostgreSQL 9.6 database cluster running on a standalone Redhat 7.2 (Maipo) server.
This may seem like a silly question. It probably *is* a silly question, so apologies in advance.
PostgreSQL was installed using the "EDB Postgres Standard" installer from EnterpriseDB - https://www.enterprisedb.com/software-downloads-postgres - and installed to a specific location - /db_<dbname>.  No repositories, nothing in a 'standard' place.
Output of pg_config is as follows:
BINDIR = /db_dbname/app/postgres/9.6.2-3/bin
DOCDIR = /db_dbname/app/postgres/9.6.2-3/doc/postgresql
HTMLDIR = /db_dbname/app/postgres/9.6.2-3/doc/postgresql
INCLUDEDIR = /db_dbname/app/postgres/9.6.2-3/include
PKGINCLUDEDIR = /db_dbname/app/postgres/9.6.2-3/include/postgresql
INCLUDEDIR-SERVER = /db_dbname/app/postgres/9.6.2-3/include/postgresql/server
LIBDIR = /db_dbname/app/postgres/9.6.2-3/lib
PKGLIBDIR = /db_dbname/app/postgres/9.6.2-3/lib/postgresql
LOCALEDIR = /db_dbname/app/postgres/9.6.2-3/share/locale
MANDIR = /db_dbname/app/postgres/9.6.2-3/share/man
SHAREDIR = /db_dbname/app/postgres/9.6.2-3/share/postgresql
SYSCONFDIR = /db_dbname/app/postgres/9.6.2-3/etc/postgresql
PGXS = /db_dbname/app/postgres/9.6.2-3/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
I have now been tasked with putting repmgr onto this box and converting it from a standalone to a multiple node setup (I have two additional servers lurking in the background ready for use :) ).
Numerous articles on repmgr all seem to suggest it should be a relatively simply operation once the software is in place. Register the master. Clone standbys. Ought to be *relatively* straight-forward.
Unfortunately, I'm having problems at the first hurdle - putting the software in place. We initially tried installing from the postgres repository rpm - which insisted, of course, on installing PostgreSQL as well as repmgr in /usr/pgsql-9.6. Obviously not the right place for it given we're running our binaries from /db_dbname/app/postgres/9.6.2-3/bin
Is there a simple way to use repmgr from the package, perhaps by copying/linking files from that location to ours? (e.g. copying/linking some files from lib, bin, contrib, etc).
Or am I looking at having to compile the source? I'm told it should be 'simple' but I've not compiled much software from scratch on linux, so I'm a bit nervous about the prospect. Any advice would be welcome :)
Basically, am I going to be stuck compiling from source or is there a way around this?

Not sure how deep you are into your present situation. The only thing I can think of is to install Postgres using the PGDG repos and then migrating the data from the EDB install to the RPM install. You would probably have to change the port numbers, at least temporarily, while you do the migration. This way you could use the packaging system without resorting to work-arounds.

I don’t think Martin has to migrate database. He has installed PostgreSQL 9.6 using EDB one-click installer. I can see two options here:
1. Install PostgreSQL using RPM as mentioned by Adrian. Stop the PostgreSQL using one click installer binaries and start using RPM binary. After that Martin can install repmgr using RPM.
2. Compile repmgr with existing installation.

Thanks & Regards,
Vibhor Kumar
Blogs:https://vibhorkumar.blog

On 05/11/2017 07:32 AM, Vibhor Kumar wrote:
>
>> On May 11, 2017, at 10:17 AM, Adrian Klaver <adrian.klaver@aklaver.com
>> <mailto:adrian.klaver@aklaver.com>> wrote:
>>

>> Not sure how deep you are into your present situation. The only thing
>> I can think of is to install Postgres using the PGDG repos and then
>> migrating the data from the EDB install to the RPM install. You would
>> probably have to change the port numbers, at least temporarily, while
>> you do the migration. This way you could use the packaging system
>> without resorting to work-arounds.
>
> I don’t think Martin has to migrate database. He has installed  > PostgreSQL 9.6 using EDB one-click installer. I can
seetwo options here: 
> 1. Install PostgreSQL using RPM as mentioned by Adrian. Stop the
> PostgreSQL using one click installer binaries and start using RPM
> binary. After that Martin can install repmgr using RPM.

 From OP:
"I have now been tasked with putting repmgr onto this box and converting
it from a standalone to a multiple node setup (I have two additional
servers lurking in the background ready for use ). "

That to me says there is data in the clusters that would need to be
migrated from the EDB instance(s) to the RPM instance(s). That could be
as simple as a dump/restore.

> 2. Compile repmgr with existing installation.
> https://github.com/2ndQuadrant/repmgr
>
> Thanks & Regards,
> Vibhor Kumar
> Blogs:https://vibhorkumar.blog
>


--
Adrian Klaver
adrian.klaver@aklaver.com




Am 11.05.2017 um 15:58 schrieb Martin Goodson:
Hello. First time poster, so please be gentle :)

I have a PostgreSQL 9.6 database cluster running on a standalone Redhat 7.2 (Maipo) server.

This may seem like a silly question. It probably *is* a silly question, so apologies in advance.

PostgreSQL was installed using the "EDB Postgres Standard" installer from EnterpriseDB - https://www.enterprisedb.com/software-downloads-postgres - and installed to a specific location - /db_<dbname>.  No repositories, nothing in a 'standard' place.


I have now been tasked with putting repmgr onto this box and converting it from a standalone to a multiple node setup (I have two additional servers lurking in the background ready for use :) ).

Numerous articles on repmgr all seem to suggest it should be a relatively simply operation once the software is in place. Register the master. Clone standbys. Ought to be *relatively* straight-forward.

Unfortunately, I'm having problems at the first hurdle - putting the software in place. We initially tried installing from the postgres repository rpm - which insisted, of course, on installing PostgreSQL as well as repmgr in /usr/pgsql-9.6. Obviously not the right place for it given we're running our binaries from /db_dbname/app/postgres/9.6.2-3/bin

Is there a simple way to use repmgr from the package, perhaps by copying/linking files from that location to ours? (e.g. copying/linking some files from lib, bin, contrib, etc).


I think, repmgr *should* work with EDB-Version of PostgreSQL. You can set pg_bindir in repmgr.conf. I would also suggest create symlinks in /etc to the repmgr.conf.

Btw.: you also set

service_start_command
service_stop_command
service_restart_command
service_reload_command
service_promote_command


Keep me informed if that works, thx.


Andreas
-- 
2ndQuadrant - The PostgreSQL Support Company.
www.2ndQuadrant.com

On May 11, 2017, at 10:40 AM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:

On 05/11/2017 07:32 AM, Vibhor Kumar wrote:
On May 11, 2017, at 10:17 AM, Adrian Klaver <adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>> wrote:


Not sure how deep you are into your present situation. The only thing I can think of is to install Postgres using the PGDG repos and then migrating the data from the EDB install to the RPM install. You would probably have to change the port numbers, at least temporarily, while you do the migration. This way you could use the packaging system without resorting to work-arounds.
I don’t think Martin has to migrate database. He has installed  > PostgreSQL 9.6 using EDB one-click installer. I can see two options here:
1. Install PostgreSQL using RPM as mentioned by Adrian. Stop the PostgreSQL using one click installer binaries and start using RPM binary. After that Martin can install repmgr using RPM.

From OP:
"I have now been tasked with putting repmgr onto this box and converting it from a standalone to a multiple node setup (I have two additional servers lurking in the background ready for use ). "

That to me says there is data in the clusters that would need to be migrated from the EDB instance(s) to the RPM instance(s). That could be as simple as a dump/restore.


Based on pg_config, I can see following:
LIBS = -lpgcommon -lpgport -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz -ledit -lrt -lcrypt -ldl -lm
VERSION = PostgreSQL 9.6.2

Since, its PostgreSQL 9.6.2, he can simply install RPM and restart the PostgreSQL using RPM binary on same data directory. If Martin is using EnterpriseDB Advanced server, then only I can see he has to migrate.

Thanks & Regards,
Vibhor Kumar
Blogs:https://vibhorkumar.blog