Postgres PgAdmin 3: Server doesn't listen - Tried everything

0

I tried opening ports in IPTables,
Set Listen address to *
Added
host all all 23.81.27.0/24 trust
and even
host all all 0.0.0.0/0 trust

YouGetSignal shows the port is closed, and i can't connect to my DB via PgAdmin.

I get

could not connect to server: Connection timed out (0x0000274C/10060) Is the server running on host "23.81.27.206" and accepting TCP/IP connections on port 5432?

Any ideas?

I already tried to reboot Postgresql, IPtables, and the server.

postgresql
psql
asked on Stack Overflow May 17, 2017 by RayCrush • edited May 17, 2017 by Shadow

2 Answers

0

With this error

could not connect to server: Connection timed out (0x0000274C/10060) Is the server running on host "23.81.27.206" and accepting TCP/IP connections on port 5432?

no need to modify hba_file. Either listen_address in postgres.conf not set to listen on external iface, or firewall blocks it/ not translating/ othernetwork issues. First case often people modify listen_address in wrong postgres.conf or do not restart server. To make sure it did not happen to you, ssh to server, psql to it and check

show config_file;
show listen_addresses;

If those ok, then still on remotes shell :

psql -h 23.81.27.206

If you get connected, stop looking into postgres config - check network (firewall, PAT,NAT,routes, your client connection ((maybe you not connected to the Internet?..)))

answered on Stack Overflow May 18, 2017 by Vao Tsun
0

Turns out it was IPTables after all. I did "Service iptables stop" And i can connect. I can't manage to allow my ip/open that port. But i guess this is how i have to do it. i just enable it whenever im done.

answered on Stack Overflow May 20, 2017 by RayCrush

User contributions licensed under CC BY-SA 3.0