Fixed port 65432 in pglogical_create_subscriber

From: William Ivanski <william(dot)ivanski(at)2ndquadrant(dot)com>
To: pgsql-pkg-debian(at)postgresql(dot)org
Subject: Fixed port 65432 in pglogical_create_subscriber
Date: 2020-09-25 04:18:30
Message-ID: CAG7+Lq__342Y7GMzhmmspPRmE=SuPRcEvPhEsMJcg9o6PjWt8A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-pkg-debian

Hi,

Operating system is Ubuntu 18.04, the issue is with package
postgresql-9.4-pglogical. I didn't test with > 9.4.

I've been trying to convert a PostgreSQL 9.4 physical standby into a
logical subscriber using pglogical_create_subscriber. It can't initialize
pglogical on the subscriber server because it can't connect to the local
PostgreSQL database after a restart, so it hangs.

As you can see below (sensitive information redacted), I have configured to
start local PostgreSQL database on port 5433. File
/etc/postgresql/9.4/main/postgresql.conf confirms port is set to 5433.

postgres(at)subserver ~ $
/usr/lib/postgresql/9.4/bin/pglogical_create_subscriber \
> -D /var/lib/postgresql/9.4/main/ -n subserver \
> --subscriber-dsn='host=127.0.0.1 port=5433 dbname=mydb user=pglogical' \
> --provider-dsn='host=192.168.0.100 port=5432 dbname=mydb user=pglogical'
\
> --hba-conf=/etc/postgresql/9.4/main/pg_hba.conf \
> --postgresql-conf=/etc/postgresql/9.4/main/postgresql.conf \
> --drop-slot-if-exists -s -v
pglogical_create_subscriber: starting ...
Getting information for database mydb ...
Creating replication slot in database mydb ...
Creating restore point "pglogical_create_subscriber_59e1d7bc" on remote
node ...
Bringing subscriber node to the restore point ...
Waiting for PostgreSQL to accept connections ....
Waiting for PostgreSQL to become primary...Waiting for PostgreSQL to accept
connections ...

Removing old pglogical configuration ...
Waiting for PostgreSQL to shutdown ...
Initializing pglogical on the subscriber node:
Waiting for PostgreSQL to accept connections ................[never ends]

pglogical_create_subscriber started the local PostgreSQL instance on port
65432, but it's expecting to connect to port 5433, so it will never be able
to connect.

I checked pglogical source code on [1] and I was not able to find any
explanation for this fixed port 65432. Then I found the pglogical source
code is being patched to start Postgres with a fixed port 65432 here [2].

[1] https://github.com/2ndQuadrant/pglogical
[2]
https://salsa.debian.org/postgresql/pglogical/-/blob/master/debian/patches/pglogical_create_subscriber_set_port.patch

--
William Ivanski - 2ndQuadrant
PostgreSQL Solutions for the Enterprise

Responses

Browse pgsql-pkg-debian by date

  From Date Subject
Next Message Michael Banck 2020-09-25 09:41:13 Re: Fixed port 65432 in pglogical_create_subscriber
Previous Message apt.postgresql.org Repository Update 2020-09-24 13:14:35 postgresql-13 updated to version 13.0-1.pgdg+1