From: | Freitag Jürgen <Juergen(dot)Freitag(at)hrz(dot)tu-freiberg(dot)de> |
---|---|
To: | "pgadmin-support(at)lists(dot)postgresql(dot)org" <pgadmin-support(at)lists(dot)postgresql(dot)org> |
Subject: | Connecting to replicated Postgres behind SSH gateway |
Date: | 2022-09-06 11:22:27 |
Message-ID: | 79fa1bebe869cb01c32d40d9c255005e0bc2f6aa.camel@hrz.tu-freiberg.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgadmin-support |
Hello,
I'd like to set up an connection in pgAdmin4 to the primary host of a
replicated Postgres cluster behind an SSH gateway.
To always connect to the primary DB host (without knowing beforehand
which one will be primary at the time of connection), I figured I have
to create a service file to feed target_session_attrs to libpq.
I created such a file, including a service for the ssh tunneled
connection (to keep it simple for testing, only IP and port of current
primary, no target_session_attrs)
and a second service to a DB server reachable without tunneling, also
only IP and port.
I already have working tunneled connections to each single DB host
behind the ssh gateway.
My results are:
* SSH tunneled connections working fine.
In "Register Server/Connection" the fields "Host name" and "Port" are
set.
* Connection via service to the DB host reachable without ssh working
fine.
In "Register Server/Connection" the fields "Host name" and "Port" are
empty, values from service are used as expected.
* Connection via service and ssh tunnel can not be set up. If I try to
combine the above (fields "Host name" and "Port" empty, field "Service"
set AND enabled SSH tunnel) I get an error "IP is not a string
(NoneType)" and I can't proceed.
Now after thinking a bit about it -- is it even possible to use libpq-
services behind ssh tunneling? If it is possible, how to set up in
pgAdmin4?
I'd be glad for any hints where to look for further information.
Best regards,
Jürgen
From | Date | Subject | |
---|---|---|---|
Next Message | Akshay Joshi | 2022-09-06 11:31:13 | Re: Error |
Previous Message | Igor Olenev | 2022-09-06 05:54:04 | Error |