【发布时间】:2017-12-18 09:57:40
【问题描述】:
我在 Azure VM 上的 Windows Server 2016 上启动 Postgres 9.6.6 时遇到问题。
当我尝试启动 Postgres 时,它会生成一个包含以下内容的日志文件:
LOG: could not bind IPv6 socket: Permission denied
HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
LOG: could not bind IPv4 socket: Permission denied
HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
WARNING: could not create listen socket for "localhost"
FATAL: could not create any TCP/IP sockets
LOG: database system is shut down
它是一个全新的虚拟机,我修改了 postgresql.conf 和 listen_addresses 以包含 127.0.0.1 但我仍然遇到相同的绑定错误。
如果我在 VM 上运行 nslookup,我会收到以下信息;
Server: Unknown
Address: 148.43.119.15
*** UnKnown can't find localhost: Non-existent domain
所以我认为 localhost 查找失败的事实可能是导致问题的原因。我已将 VM 上的主机文件修改为:
127.0.0.1 localhost
:1 localhost
但同样的错误正在发生,所以我认为这是我在网络方面没有设置但不知道在哪里寻找的东西。
【问题讨论】:
-
请分享
listen_addresses和unix_socket_directories的postgreqls.conf -
listen_addresses = '127.0.0.1,localhost,148.43.119.15' unix 套接字目录为空白并被注释掉。 #unix_socket_directories = ''
-
哪个用户正在运行 postgrees 进程?此用户必须具有在这些端口中绑定和 lsiten 的权限。
-
运行该进程的用户是 Windows 管理员组的成员。
-
@DevOverflow 当你停止postgresql
net stop postgresql-x64-9.6,然后执行netstat -atn|findstr 5432结果是什么,端口5432正在监听?
标签: postgresql azure localhost virtual-machine