Connecting to replicated Postgres behind SSH gateway

Поиск
Список
Период
Сортировка
От Freitag Jürgen
Тема Connecting to replicated Postgres behind SSH gateway
Дата
Msg-id 79fa1bebe869cb01c32d40d9c255005e0bc2f6aa.camel@hrz.tu-freiberg.de
обсуждение исходный текст
Список 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



Вложения

В списке pgadmin-support по дате отправления:

Предыдущее
От: Igor Olenev
Дата:
Сообщение: Error
Следующее
От: Akshay Joshi
Дата:
Сообщение: Re: Error