repmgr for Redhat Postgres binary

28 views
Skip to first unread message

Zhi Li

unread,
Mar 2, 2021, 7:48:30 PMMar 2
to repmgr
Hi Gurus,

We have used OpenSource Postgres binary with repmgr for a while. Recently planning to use Redhat provided Postgres binary. Since the Redhat binary directory structure is so different, we have difficulty setup repmgr properly. Is there any way we can resolve this? Will recompile repmgr from source code help?

Our current setup is Postgres 10.15 on Redhat 7. We are trying to use latest repmgr 5.1.

Thanks in advance!
Zhi

Ian Barwick

unread,
Mar 2, 2021, 10:16:59 PMMar 2
to rep...@googlegroups.com, Zhi Li
On 03/03/2021 09:48, Zhi Li wrote:
> Hi Gurus,
>
> We have used OpenSource Postgres binary with repmgr for a while. Recently
> planning to use Redhat provided Postgres binary. Since the Redhat binary
> directory structure is so different, we have difficulty setup repmgr
> properly. Is there any way we can resolve this? Will recompile repmgr from
> source code help?

As the RedHat packages are proprietary, we are unable to provide matching
packages.

If the vendor (RedHat) is unable to to this, your options as (as you
mention) building from source, or building your own packages.

See also this FAQ entry:
https://repmgr.org/docs/current/faq-general.html#FAQ-THIRD-PARTY-PACKAGES


> Our current setup is Postgres 10.15 on Redhat 7. We are trying to use latest
> repmgr 5.1.

FYI, latest repmgr is 5.2.1


Regards

Ian Barwick

--
Ian Barwick https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Bach Nguyet Tien

unread,
Jun 29, 2021, 9:08:09 AMJun 29
to repmgr
I have a same issue and trying to build from source.  I get error 1st that is

# tar -xvf repmgr--5.2.1.tar
# cd /u01/repmgr-5.2.1
#./configure && make install 
"checking for a sed that does not truncate output ... /bin/sed
checking for pg_config ... no
configure: error: coudl nto find pg_config, set PG_CONFID or PATH  "

I set the export PG_CONFIG=/opt/rh/rh-postgresql12/root/user/bin/pg_config and re install repmgr and still doesn't work
# cd /u01/repmgr-5.2.1
#./configure && make install 
checking for a sed that does not truncate output ...  /bin/sed
./configure: line 1816: test: :  integer expression expected
configure: error: could not detect the PostgreSQL version, wrong or broken pg_config

How can I correct and build the package?

v/r,

Bach-Nga

Bach Nguyet Tien

unread,
Jun 29, 2021, 9:43:14 AMJun 29
to repmgr
I also added the "export PG_CONFIG=/opt/rh/rh-postgresql12/root/user/bin/pg_config" on configure script and rerun the ./configure && make install.  Get the same error.
/configure: line 1819: test: :  integer expression expected
configure: error: could not detect the PostgreSQL version, wrong or broken pg_config

Bach-Nga

Ian Barwick

unread,
Jun 29, 2021, 7:50:25 PMJun 29
to rep...@googlegroups.com
On 29/06/2021 22:43, Bach Nguyet Tien wrote:
> I also added the "export PG_CONFIG=/opt/rh/rh-postgresql12/root/user/bin/pg_config" on configure script and rerun the ./configure && make install.  Get the same error.
> /configure: line 1819: test: :  integer expression expected
> configure: error: could not detect the PostgreSQL version, wrong or broken pg_config

You need to locate the pg_config binary associated with the RedHat PostgreSQL
package you're trying to build repmgr against.

Something like "rpm -qi $name_of_redhat_postgresql_package" | grep bin/pg_config"
should show the path. I'm not sure which package exactly; assuming the RedHat
packaging is structured in the same way as the community RPMs it might be something
like "redhat-postgresql13".

For reference I note also this repmgr FAQ item:

https://repmgr.org/docs/current/faq-general.html#FAQ-THIRD-PARTY-PACKAGES

Regards

Ian Barwick
> https://repmgr.org/docs/current/faq-general.html#FAQ-THIRD-PARTY-PACKAGES <https://repmgr.org/docs/current/faq-general.html#FAQ-THIRD-PARTY-PACKAGES>
>
>
> > Our current setup is Postgres 10.15 on Redhat 7. We are trying to use latest
> > repmgr 5.1.
>
> FYI, latest repmgr is 5.2.1
>
>
> Regards
>
> Ian Barwick
>
> --
> Ian Barwick https://www.2ndQuadrant.com/ <https://www.2ndQuadrant.com/>
> PostgreSQL Development, 24x7 Support, Training & Services
>
> --
> You received this message because you are subscribed to the Google Groups "repmgr" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to repmgr+un...@googlegroups.com <mailto:repmgr+un...@googlegroups.com>.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/repmgr/28c0230c-7724-473b-afde-3d99e334a1aan%40googlegroups.com <https://groups.google.com/d/msgid/repmgr/28c0230c-7724-473b-afde-3d99e334a1aan%40googlegroups.com?utm_medium=email&utm_source=footer>.

Bach Nguyet Tien

unread,
Jun 29, 2021, 8:17:38 PMJun 29
to repmgr
I did sir and the path of pg_config is  /opt/rh/rh-postgresql12/root/user/bin/pg_config  
and still not working when I configure && make install from repmgr source

when I yum install from rpm package it requires postgresql-server and I am using rh-postgres binary.

the install is not create yet how can I specify the data directory location in repmgr.conf when repmgr.conf is not existed.
ask SA to check and see if repmgr associate from redhat.com and couldn't find one.  Just wonder how to install/configure it work with rh-postgresql binary.

v/r,

Bach-Nga

Ian Barwick

unread,
Jun 29, 2021, 8:22:17 PMJun 29
to rep...@googlegroups.com, Bach Nguyet Tien
On 30/06/2021 09:17, Bach Nguyet Tien wrote:
> I did sir and the path of pg_config is /opt/rh/rh-postgresql12/root/user/bin/pg_config
> and still not working when I configure && make install from repmgr source

What is the output of:

/opt/rh/rh-postgresql12/root/user/bin/pg_config --version

> when I yum install from rpm package it requires postgresql-server and I am using rh-postgres binary.

Yes, that is an unavoidable problem if using third-party PostgreSQL packages which don't
match the PGDG package structure.


Regards

Ian Barwick

> the install is not create yet how can I specify the data directory location in repmgr.conf when repmgr.conf is not existed.
> ask SA to check and see if repmgr associate from redhat.com and couldn't find one.  Just wonder how to install/configure it work with rh-postgresql binary.
>
> v/r,
>
> Bach-Nga
> On Tuesday, June 29, 2021 at 7:50:25 PM UTC-4 ian.b...@2ndquadrant.com wrote:
>
> On 29/06/2021 22:43, Bach Nguyet Tien wrote:
> > I also added the "export PG_CONFIG=/opt/rh/rh-postgresql12/root/user/bin/pg_config" on configure script and rerun the ./configure && make install.  Get the same error.
> > /configure: line 1819: test: :  integer expression expected
> > configure: error: could not detect the PostgreSQL version, wrong or broken pg_config
>
> You need to locate the pg_config binary associated with the RedHat PostgreSQL
> package you're trying to build repmgr against.
>
> Something like "rpm -qi $name_of_redhat_postgresql_package" | grep bin/pg_config"
> should show the path. I'm not sure which package exactly; assuming the RedHat
> packaging is structured in the same way as the community RPMs it might be something
> like "redhat-postgresql13".
>
> For reference I note also this repmgr FAQ item:
>
> https://repmgr.org/docs/current/faq-general.html#FAQ-THIRD-PARTY-PACKAGES <https://repmgr.org/docs/current/faq-general.html#FAQ-THIRD-PARTY-PACKAGES>
> > https://repmgr.org/docs/current/faq-general.html#FAQ-THIRD-PARTY-PACKAGES <https://repmgr.org/docs/current/faq-general.html#FAQ-THIRD-PARTY-PACKAGES> <https://repmgr.org/docs/current/faq-general.html#FAQ-THIRD-PARTY-PACKAGES <https://repmgr.org/docs/current/faq-general.html#FAQ-THIRD-PARTY-PACKAGES>>
> >
> >
> > > Our current setup is Postgres 10.15 on Redhat 7. We are trying to use latest
> > > repmgr 5.1.
> >
> > FYI, latest repmgr is 5.2.1
> >
> >
> > Regards
> >
> > Ian Barwick
> >
> > --
> > Ian Barwick https://www.2ndQuadrant.com/ <https://www.2ndQuadrant.com/> <https://www.2ndQuadrant.com/ <https://www.2ndQuadrant.com/>>
> > PostgreSQL Development, 24x7 Support, Training & Services
> >
> > --
> > You received this message because you are subscribed to the Google Groups "repmgr" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to repmgr+un...@googlegroups.com <mailto:repmgr+un...@googlegroups.com>.
> > To view this discussion on the web, visit https://groups.google.com/d/msgid/repmgr/28c0230c-7724-473b-afde-3d99e334a1aan%40googlegroups.com <https://groups.google.com/d/msgid/repmgr/28c0230c-7724-473b-afde-3d99e334a1aan%40googlegroups.com> <https://groups.google.com/d/msgid/repmgr/28c0230c-7724-473b-afde-3d99e334a1aan%40googlegroups.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/repmgr/28c0230c-7724-473b-afde-3d99e334a1aan%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
>
> --
> Ian Barwick https://www.2ndQuadrant.com/ <https://www.2ndQuadrant.com/>
> PostgreSQL Development, 24x7 Support, Training & Services
>
> --
> You received this message because you are subscribed to the Google Groups "repmgr" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to repmgr+un...@googlegroups.com <mailto:repmgr+un...@googlegroups.com>.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/repmgr/70304691-54ec-4caf-ac16-47db6bd9aae4n%40googlegroups.com <https://groups.google.com/d/msgid/repmgr/70304691-54ec-4caf-ac16-47db6bd9aae4n%40googlegroups.com?utm_medium=email&utm_source=footer>.
Message has been deleted
Message has been deleted

Bach Nguyet Tien

unread,
Jun 30, 2021, 9:58:35 AMJun 30
to repmgr
>> /opt/rh/rh-postgresql12/root/user/bin/pg_config --version
PostgreSQL 12.5

now when I run the './configure &&  make install"  after export pg_config= /opt/rh/rh-postgresql12/root/user/bin/pg_config and yum the missing package like gcc and flex
I still  get a whole bunch of sed information that does not truncate output .. /bin/sed
configure: building againsta PostgreSQL 12.3
checking for gnused .. no
checking for gsed .. no
checking for sed ... yes
configure: creaing ./config.status
config.status: creating Makefile
config.status: creating Makefile.global
config.status: creating config.h
Buidling against PostgreSQL 12
flex -o:configfile-scan.c' configfile-scan.1
gcc .....-std=gnu99 -Wall Wmissing-prototypes..... (long information... can't type them all since it from the different enclave, high side)
..........................
................
........ -L/opt/rh/rh-postgresql12/root/usr/lib64 -lpgcommon -lpgport -L/opt/rh/rh-postgresql12/root/user/lib64 -lpq -L/opt/rh/rh-postgresql12/root/usr/lib64 -W1, -z,relro -Wl, - - as-needed, -o repmgr
/bin/ld: cannot find -lpgcommong
/bin/ld: cannot find -plgport
collect2: error: ld returned 1 exit status
make: *** [repmgr] Error 1


v/r,
Bach-Nga

Bach Nguyet Tien

unread,
Jun 30, 2021, 11:15:28 AMJun 30
to repmgr
I "which ld"
/bin/ld
but don't see lpgcommon or lpgport. Where can I get them?

v/r,

Bach-Nga

Ian Barwick

unread,
Jul 1, 2021, 2:17:05 AMJul 1
to rep...@googlegroups.com, Bach Nguyet Tien
On 01/07/2021 00:15, Bach Nguyet Tien wrote:
> I "which ld"
> /bin/ld
> but don't see lpgcommon or lpgport. Where can I get them?

Have you installed the appopriate devel package?

The community packages are "postgresql${majorversion}"-devel, e.g.:

[root@node01 ~]# rpm -ql postgresql13-devel | grep pgcommon
/usr/pgsql-13/lib/libpgcommon.a
/usr/pgsql-13/lib/libpgcommon_shlib.a


so you'd need to check the RedHat equivalent is installed.

Regards

Ian Barwick
> > ask SA to check and see if repmgr associate from redhat.com <http://redhat.com> and couldn't find one.  Just wonder how to install/configure it work with rh-postgresql binary.
> >
> > v/r,
> >
> > Bach-Nga
> > On Tuesday, June 29, 2021 at 7:50:25 PM UTC-4 ian.b...@2ndquadrant.com wrote:
> >
> > On 29/06/2021 22:43, Bach Nguyet Tien wrote:
> > > I also added the "export PG_CONFIG=/opt/rh/rh-postgresql12/root/user/bin/pg_config" on configure script and rerun the ./configure && make install.  Get the same error.
> > > /configure: line 1819: test: :  integer expression expected
> > > configure: error: could not detect the PostgreSQL version, wrong or broken pg_config
> >
> > You need to locate the pg_config binary associated with the RedHat PostgreSQL
> > package you're trying to build repmgr against.
> >
> > Something like "rpm -qi $name_of_redhat_postgresql_package" | grep bin/pg_config"
> > should show the path. I'm not sure which package exactly; assuming the RedHat
> > packaging is structured in the same way as the community RPMs it might be something
> > like "redhat-postgresql13".
> >
> > For reference I note also this repmgr FAQ item:
> >
> > https://repmgr.org/docs/current/faq-general.html#FAQ-THIRD-PARTY-PACKAGES <https://repmgr.org/docs/current/faq-general.html#FAQ-THIRD-PARTY-PACKAGES> <https://repmgr.org/docs/current/faq-general.html#FAQ-THIRD-PARTY-PACKAGES <https://repmgr.org/docs/current/faq-general.html#FAQ-THIRD-PARTY-PACKAGES>>
> > > https://repmgr.org/docs/current/faq-general.html#FAQ-THIRD-PARTY-PACKAGES <https://repmgr.org/docs/current/faq-general.html#FAQ-THIRD-PARTY-PACKAGES> <https://repmgr.org/docs/current/faq-general.html#FAQ-THIRD-PARTY-PACKAGES <https://repmgr.org/docs/current/faq-general.html#FAQ-THIRD-PARTY-PACKAGES>> <https://repmgr.org/docs/current/faq-general.html#FAQ-THIRD-PARTY-PACKAGES <https://repmgr.org/docs/current/faq-general.html#FAQ-THIRD-PARTY-PACKAGES> <https://repmgr.org/docs/current/faq-general.html#FAQ-THIRD-PARTY-PACKAGES <https://repmgr.org/docs/current/faq-general.html#FAQ-THIRD-PARTY-PACKAGES>>>
> > >
> > >
> > > > Our current setup is Postgres 10.15 on Redhat 7. We are trying to use latest
> > > > repmgr 5.1.
> > >
> > > FYI, latest repmgr is 5.2.1
> > >
> > >
> > > Regards
> > >
> > > Ian Barwick
> > >
> > > --
> > > Ian Barwick https://www.2ndQuadrant.com/ <https://www.2ndQuadrant.com/> <https://www.2ndQuadrant.com/ <https://www.2ndQuadrant.com/>> <https://www.2ndQuadrant.com/ <https://www.2ndQuadrant.com/> <https://www.2ndQuadrant.com/ <https://www.2ndQuadrant.com/>>>
> > > PostgreSQL Development, 24x7 Support, Training & Services
> > >
> > > --
> > > You received this message because you are subscribed to the Google Groups "repmgr" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an email to repmgr+un...@googlegroups.com <mailto:repmgr+un...@googlegroups.com>.
> > > To view this discussion on the web, visit https://groups.google.com/d/msgid/repmgr/28c0230c-7724-473b-afde-3d99e334a1aan%40googlegroups.com <https://groups.google.com/d/msgid/repmgr/28c0230c-7724-473b-afde-3d99e334a1aan%40googlegroups.com> <https://groups.google.com/d/msgid/repmgr/28c0230c-7724-473b-afde-3d99e334a1aan%40googlegroups.com <https://groups.google.com/d/msgid/repmgr/28c0230c-7724-473b-afde-3d99e334a1aan%40googlegroups.com>> <https://groups.google.com/d/msgid/repmgr/28c0230c-7724-473b-afde-3d99e334a1aan%40googlegroups.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/repmgr/28c0230c-7724-473b-afde-3d99e334a1aan%40googlegroups.com?utm_medium=email&utm_source=footer> <https://groups.google.com/d/msgid/repmgr/28c0230c-7724-473b-afde-3d99e334a1aan%40googlegroups.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/repmgr/28c0230c-7724-473b-afde-3d99e334a1aan%40googlegroups.com?utm_medium=email&utm_source=footer>>>.
> >
> >
> > --
> > Ian Barwick https://www.2ndQuadrant.com/ <https://www.2ndQuadrant.com/> <https://www.2ndQuadrant.com/ <https://www.2ndQuadrant.com/>>
> > PostgreSQL Development, 24x7 Support, Training & Services
> >
> > --
> > You received this message because you are subscribed to the Google Groups "repmgr" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to repmgr+un...@googlegroups.com <mailto:repmgr+un...@googlegroups.com>.
> > To view this discussion on the web, visit https://groups.google.com/d/msgid/repmgr/70304691-54ec-4caf-ac16-47db6bd9aae4n%40googlegroups.com <https://groups.google.com/d/msgid/repmgr/70304691-54ec-4caf-ac16-47db6bd9aae4n%40googlegroups.com> <https://groups.google.com/d/msgid/repmgr/70304691-54ec-4caf-ac16-47db6bd9aae4n%40googlegroups.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/repmgr/70304691-54ec-4caf-ac16-47db6bd9aae4n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
>
> --
> Ian Barwick https://www.2ndQuadrant.com/ <https://www.2ndQuadrant.com/>
> PostgreSQL Development, 24x7 Support, Training & Services
>
> --
> You received this message because you are subscribed to the Google Groups "repmgr" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to repmgr+un...@googlegroups.com <mailto:repmgr+un...@googlegroups.com>.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/repmgr/d1c25a2a-2934-4621-a2a3-6e557c56f3e0n%40googlegroups.com <https://groups.google.com/d/msgid/repmgr/d1c25a2a-2934-4621-a2a3-6e557c56f3e0n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Bach Nguyet Tien

unread,
Jul 1, 2021, 8:26:18 AMJul 1
to repmgr
I have grep and found nothing.  Ask SA and he said it's failing at the linking step and didn't download a new package of rh-postgresql-devel yet.

Question, repmgr works if  I yum the repmgr package with --nodeps?  What is the next step to configure the replication?
Also, how do I reply email with ">>" here?  Do I need to drag the whole message and manually edit ">>"  for my answer?

v/r,
Bach-Nga
thank you.
Reply all
Reply to author
Forward
0 new messages