【问题标题】:Postgres failing to start on Windows Server 2016 in AzurePostgres 无法在 Azure 中的 Windows Server 2016 上启动
【发布时间】: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_addressesunix_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


【解决方案1】:

如果我的理解是正确的,148.43.119.15 是您虚拟机的公共 IP。你无法在 IP 上监听 postgresql,如果我设置与你类似,我会得到相同的结果。

请修改postgreqls.conf

listen_addresses = '*'

对于 Azure VM,如果您想使用公共 IP 访问 postgresql,您需要打开端口 在 Azure NSG 和 Windows 防火墙上。

【讨论】:

    猜你喜欢
    • 2020-04-01
    • 2020-04-03
    • 2018-09-08
    • 1970-01-01
    • 2018-02-26
    • 2019-01-10
    • 1970-01-01
    • 1970-01-01
    • 2021-10-10
    相关资源
    最近更新 更多