Fixed port 65432 in pglogical_create_subscriber - Mailing list pgsql-pkg-debian

From William Ivanski
Subject Fixed port 65432 in pglogical_create_subscriber
Date
Msg-id CAG7+Lq__342Y7GMzhmmspPRmE=SuPRcEvPhEsMJcg9o6PjWt8A@mail.gmail.com
Whole thread Raw
Responses Re: Fixed port 65432 in pglogical_create_subscriber  (Michael Banck <michael.banck@credativ.de>)
Re: Fixed port 65432 in pglogical_create_subscriber  (Michael Banck <michael.banck@credativ.de>)
List 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@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].



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

pgsql-pkg-debian by date:

Previous
From: apt.postgresql.org Repository Update
Date:
Subject: postgresql-13 updated to version 13.0-1.pgdg+1
Next
From: Michael Banck
Date:
Subject: Re: Fixed port 65432 in pglogical_create_subscriber