Postgresql Server已启动。。但端口(5432)未侦听
我已经在ubuntu 16.04 LTS上安装了postgresql 10。我已更改配置如下 在pg_hba.conf中Postgresql Server已启动。。但端口(5432)未侦听,postgresql,ubuntu-16.04,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
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
当我检查服务器上的服务状态时,它已启动并正在运行。
但端口(5432)未在服务器上侦听
netstat-pant | grep 5432
什么也没有返回请帮忙为ipv4再添加一条规则:
host all all ::/0 md5
在pg_hba.conf中,我已经将“local”类型的方法更改为“trust”,完成了!
local all postgres peer
local all all peer
host all all 0.0.0.0/0 md5
host all all ::1/128 md5
这不会影响服务器进程正在侦听的端口,但不会::/0 ipv6?您可以使用
psql
登录吗?如果是,您可以运行select setting,sourcefile from pg_settings,其中name='port'
要检查实际配置的值和配置该值的文件dalso,这些设置不是动态的。您必须使用systemctl restart PostgreSQL重新启动PostgreSQL才能使其生效。我也重新启动了该服务。但它不起作用。。然后,我更改了md5和信任对等,并重新启动了服务。现在它工作得很好。但我仍然有一个问题,为什么该端口没有列在netstat命令中?根据注释,local仅用于域套接字,所以它一定不会影响tcp侦听端口。