Can't Open Port 5432 on Ubuntu 16.04 Server [closed]
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
BACKGROUND
Hey guys, hopefully this is an easy fix. I've done all the basic troubleshooting and am still not finding any luck.
I'm using an Ubuntu 16.04 Google Compute Engine server and am not able to open port 5432 for PostgreSQL.
ufw is enabled, and I can tell other ports are open via
nc -zv ipAddress 80
, nc -zv ipAddress 22
, etc.
nc -zv ipAddress 5432
just times out. pgAdmin4 can't connect to the server via port 5432 either.
ALREADY TRIED
sudo ufw allow 5432/tcp
sudo ufw allow 5432
(just thought I'd give it a try)
In /etc/postgresql/9.5/main/postgresql.conf
listen_addresses = '*'
In /etc/postgresql/9.5/main/pg_hba.conf
host all all 0.0.0.0/0 md5
host all all ::0/0 md5
ALSO TRIED
host all all 0.0.0.0/0 trust
host all all ::0/0 trust
ACTUAL FILES
Here are the current versions of the relevant parts of the aforementioned files:
postgresql.conf
listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
port = 5432 # (change requires restart)
max_connections = 100 # (change requires restart)
#superuser_reserved_connections = 3 # (change requires restart)
unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories
pg_hba.conf
# Database administrative login by Unix domain socket
local all postgres peer
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# All connections
host all all 0.0.0.0/0 md5
host all all ::0/0 md5
firewall postgresql
closed as off-topic by DopeGhoti, Goro, RalfFriedl, Thomas, G-Man Sep 27 at 21:25
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." â DopeGhoti, Goro, RalfFriedl, Thomas
add a comment |Â
up vote
1
down vote
favorite
BACKGROUND
Hey guys, hopefully this is an easy fix. I've done all the basic troubleshooting and am still not finding any luck.
I'm using an Ubuntu 16.04 Google Compute Engine server and am not able to open port 5432 for PostgreSQL.
ufw is enabled, and I can tell other ports are open via
nc -zv ipAddress 80
, nc -zv ipAddress 22
, etc.
nc -zv ipAddress 5432
just times out. pgAdmin4 can't connect to the server via port 5432 either.
ALREADY TRIED
sudo ufw allow 5432/tcp
sudo ufw allow 5432
(just thought I'd give it a try)
In /etc/postgresql/9.5/main/postgresql.conf
listen_addresses = '*'
In /etc/postgresql/9.5/main/pg_hba.conf
host all all 0.0.0.0/0 md5
host all all ::0/0 md5
ALSO TRIED
host all all 0.0.0.0/0 trust
host all all ::0/0 trust
ACTUAL FILES
Here are the current versions of the relevant parts of the aforementioned files:
postgresql.conf
listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
port = 5432 # (change requires restart)
max_connections = 100 # (change requires restart)
#superuser_reserved_connections = 3 # (change requires restart)
unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories
pg_hba.conf
# Database administrative login by Unix domain socket
local all postgres peer
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# All connections
host all all 0.0.0.0/0 md5
host all all ::0/0 md5
firewall postgresql
closed as off-topic by DopeGhoti, Goro, RalfFriedl, Thomas, G-Man Sep 27 at 21:25
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." â DopeGhoti, Goro, RalfFriedl, Thomas
1
Have you verified that Postgres is actually running?
â RalfFriedl
Sep 25 at 19:07
Have you checked to see (presuming the service is running) whether it's even trying to listen on that port (ss -plnt | grep 5432
)?
â DopeGhoti
Sep 25 at 19:09
Checked, and it is running. @DopeGhoti here's the output of that commandLISTEN 0 128 *:5432 *:*
LISTEN 0 128 :::5432 :::*
â In_Circ
Sep 25 at 19:19
Yourufw
syntax looks wrong... shouldn't it beufw allow 5432
or similar - the key being theallow
part ?
â ivanivan
Sep 25 at 19:54
@ivanivan you're right; I had a typo. I did usesudo ufw allow 5432/tcp
in the command line, and the rules do show up undersudo ufw status
â In_Circ
Sep 25 at 19:57
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
BACKGROUND
Hey guys, hopefully this is an easy fix. I've done all the basic troubleshooting and am still not finding any luck.
I'm using an Ubuntu 16.04 Google Compute Engine server and am not able to open port 5432 for PostgreSQL.
ufw is enabled, and I can tell other ports are open via
nc -zv ipAddress 80
, nc -zv ipAddress 22
, etc.
nc -zv ipAddress 5432
just times out. pgAdmin4 can't connect to the server via port 5432 either.
ALREADY TRIED
sudo ufw allow 5432/tcp
sudo ufw allow 5432
(just thought I'd give it a try)
In /etc/postgresql/9.5/main/postgresql.conf
listen_addresses = '*'
In /etc/postgresql/9.5/main/pg_hba.conf
host all all 0.0.0.0/0 md5
host all all ::0/0 md5
ALSO TRIED
host all all 0.0.0.0/0 trust
host all all ::0/0 trust
ACTUAL FILES
Here are the current versions of the relevant parts of the aforementioned files:
postgresql.conf
listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
port = 5432 # (change requires restart)
max_connections = 100 # (change requires restart)
#superuser_reserved_connections = 3 # (change requires restart)
unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories
pg_hba.conf
# Database administrative login by Unix domain socket
local all postgres peer
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# All connections
host all all 0.0.0.0/0 md5
host all all ::0/0 md5
firewall postgresql
BACKGROUND
Hey guys, hopefully this is an easy fix. I've done all the basic troubleshooting and am still not finding any luck.
I'm using an Ubuntu 16.04 Google Compute Engine server and am not able to open port 5432 for PostgreSQL.
ufw is enabled, and I can tell other ports are open via
nc -zv ipAddress 80
, nc -zv ipAddress 22
, etc.
nc -zv ipAddress 5432
just times out. pgAdmin4 can't connect to the server via port 5432 either.
ALREADY TRIED
sudo ufw allow 5432/tcp
sudo ufw allow 5432
(just thought I'd give it a try)
In /etc/postgresql/9.5/main/postgresql.conf
listen_addresses = '*'
In /etc/postgresql/9.5/main/pg_hba.conf
host all all 0.0.0.0/0 md5
host all all ::0/0 md5
ALSO TRIED
host all all 0.0.0.0/0 trust
host all all ::0/0 trust
ACTUAL FILES
Here are the current versions of the relevant parts of the aforementioned files:
postgresql.conf
listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
port = 5432 # (change requires restart)
max_connections = 100 # (change requires restart)
#superuser_reserved_connections = 3 # (change requires restart)
unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories
pg_hba.conf
# Database administrative login by Unix domain socket
local all postgres peer
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# All connections
host all all 0.0.0.0/0 md5
host all all ::0/0 md5
firewall postgresql
firewall postgresql
edited Sep 25 at 19:55
asked Sep 25 at 19:03
In_Circ
113
113
closed as off-topic by DopeGhoti, Goro, RalfFriedl, Thomas, G-Man Sep 27 at 21:25
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." â DopeGhoti, Goro, RalfFriedl, Thomas
closed as off-topic by DopeGhoti, Goro, RalfFriedl, Thomas, G-Man Sep 27 at 21:25
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." â DopeGhoti, Goro, RalfFriedl, Thomas
1
Have you verified that Postgres is actually running?
â RalfFriedl
Sep 25 at 19:07
Have you checked to see (presuming the service is running) whether it's even trying to listen on that port (ss -plnt | grep 5432
)?
â DopeGhoti
Sep 25 at 19:09
Checked, and it is running. @DopeGhoti here's the output of that commandLISTEN 0 128 *:5432 *:*
LISTEN 0 128 :::5432 :::*
â In_Circ
Sep 25 at 19:19
Yourufw
syntax looks wrong... shouldn't it beufw allow 5432
or similar - the key being theallow
part ?
â ivanivan
Sep 25 at 19:54
@ivanivan you're right; I had a typo. I did usesudo ufw allow 5432/tcp
in the command line, and the rules do show up undersudo ufw status
â In_Circ
Sep 25 at 19:57
add a comment |Â
1
Have you verified that Postgres is actually running?
â RalfFriedl
Sep 25 at 19:07
Have you checked to see (presuming the service is running) whether it's even trying to listen on that port (ss -plnt | grep 5432
)?
â DopeGhoti
Sep 25 at 19:09
Checked, and it is running. @DopeGhoti here's the output of that commandLISTEN 0 128 *:5432 *:*
LISTEN 0 128 :::5432 :::*
â In_Circ
Sep 25 at 19:19
Yourufw
syntax looks wrong... shouldn't it beufw allow 5432
or similar - the key being theallow
part ?
â ivanivan
Sep 25 at 19:54
@ivanivan you're right; I had a typo. I did usesudo ufw allow 5432/tcp
in the command line, and the rules do show up undersudo ufw status
â In_Circ
Sep 25 at 19:57
1
1
Have you verified that Postgres is actually running?
â RalfFriedl
Sep 25 at 19:07
Have you verified that Postgres is actually running?
â RalfFriedl
Sep 25 at 19:07
Have you checked to see (presuming the service is running) whether it's even trying to listen on that port (
ss -plnt | grep 5432
)?â DopeGhoti
Sep 25 at 19:09
Have you checked to see (presuming the service is running) whether it's even trying to listen on that port (
ss -plnt | grep 5432
)?â DopeGhoti
Sep 25 at 19:09
Checked, and it is running. @DopeGhoti here's the output of that command
LISTEN 0 128 *:5432 *:*
LISTEN 0 128 :::5432 :::*
â In_Circ
Sep 25 at 19:19
Checked, and it is running. @DopeGhoti here's the output of that command
LISTEN 0 128 *:5432 *:*
LISTEN 0 128 :::5432 :::*
â In_Circ
Sep 25 at 19:19
Your
ufw
syntax looks wrong... shouldn't it be ufw allow 5432
or similar - the key being the allow
part ?â ivanivan
Sep 25 at 19:54
Your
ufw
syntax looks wrong... shouldn't it be ufw allow 5432
or similar - the key being the allow
part ?â ivanivan
Sep 25 at 19:54
@ivanivan you're right; I had a typo. I did use
sudo ufw allow 5432/tcp
in the command line, and the rules do show up under sudo ufw status
â In_Circ
Sep 25 at 19:57
@ivanivan you're right; I had a typo. I did use
sudo ufw allow 5432/tcp
in the command line, and the rules do show up under sudo ufw status
â In_Circ
Sep 25 at 19:57
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
1
Have you verified that Postgres is actually running?
â RalfFriedl
Sep 25 at 19:07
Have you checked to see (presuming the service is running) whether it's even trying to listen on that port (
ss -plnt | grep 5432
)?â DopeGhoti
Sep 25 at 19:09
Checked, and it is running. @DopeGhoti here's the output of that command
LISTEN 0 128 *:5432 *:*
LISTEN 0 128 :::5432 :::*
â In_Circ
Sep 25 at 19:19
Your
ufw
syntax looks wrong... shouldn't it beufw allow 5432
or similar - the key being theallow
part ?â ivanivan
Sep 25 at 19:54
@ivanivan you're right; I had a typo. I did use
sudo ufw allow 5432/tcp
in the command line, and the rules do show up undersudo ufw status
â In_Circ
Sep 25 at 19:57