J
J
johnmohnachev2015-12-12 19:34:24
linux
johnmohnachev, 2015-12-12 19:34:24

How to connect to a remote Postgresql server?

I have a Debian 8 server with Postgresql-9.4 installed and a PgAdmin client on my work machine.
When I try to connect from PgAdmin to Postgresql on a remote server I get an error:
Server doesn't listen
The server doesn't accept connections: the connection library reports
could not connect to server: Connection timed out (0x0000274C/10060) Is the server running on host "52.90.210.0" and accepting TCP/IP connections on port 5432?

In the Postgresql configuration, I specified that it would listen to all addresses
1f00f72d73ca461cafa3aedd5fb63f32.jpg
. In pg_hba, it also allowed all ips to work with all databases
9eb22b6dd9bf48ac9428b83eb09f62c1.jpg
. Judging by netstat, postgresql listens on port 5432
c3eca0e0a86341898ee67a2c210a4048.jpg
iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
После конфигурации сервер был перезагружен.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
johnmohnachev, 2015-12-12
@johnmohnachev

Ребят, всем спасибо за участие. Проблему решил.
Сервер размещен на aws.amazon.com и в настройках instance было разрешение только на подключение по SSH на 22 порт.

M
mureevms, 2015-12-12
@mureevms

Судя по всему у Вас используется VPS\VDS. У некоторых хостинг провайдеров фаервол включен по умолчанию. Откройте в админке порт для Postgre.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question