Prabath Dolawatta
Prabath Dolawatta

Reputation: 619

Postgresql Server started .. But port(5432) is not listening

I have install postgresql 10 on ubuntu 16.04 LTS. I have change the configuration as below.

In pg_hba.conf

local   all             postgres                                peer

local   all             all                                     peer

host    all             all             0.0.0.0/0               md5
host    all             all             ::1/128                 md5

In 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 = 500                   # (change requires restart)
#superuser_reserved_connections = 3     # (change requires restart)
unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories

when I check the service status on the server it's up and running. enter image description here

But Port(5432) is not listening on the server.

netstat -pant | grep 5432

nothing returned ...! Please help.....!

Upvotes: 1

Views: 6519

Answers (2)

SATAN
SATAN

Reputation: 170

been fighting with the same error, I've changed the method for "local" type to "trust" and it's done! enter image description here

Upvotes: 0

Thanh Nguyen Van
Thanh Nguyen Van

Reputation: 11752

Add one more rule for ipv4 :

host    all             all              ::/0                            md5

into pg_hba.conf

Upvotes: 1

Related Questions