Postgresql Server已启动..但端口(5432)没有监听

时间:2018-11-05 06:32:32

标签: postgresql ubuntu-16.04

我在ubuntu 16.04 LTS上安装了postgresql 10。我已经更改了如下配置。

在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

在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

当我检查服务器上的服务状态并已启动时。 enter image description here

但是Port(5432)没有在服务器上侦听。

netstat -pant | grep 5432

什么也没回来...! 请帮助.......!

2 个答案:

答案 0 :(得分:1)

为ipv4添加另一条规则:

host    all             all              ::/0                            md5

进入pg_hba.conf

答案 1 :(得分:0)

由于遇到了同样的错误,我已经将“本地”类型的方法更改为“信任”,并且完成了! enter image description here

相关问题