【问题标题】:Cannot connect to postgresql from remote address无法从远程地址连接到 postgresql
【发布时间】:2016-09-26 02:37:22
【问题描述】:

我使用ubuntu 14.04postgresql 9.5

我已经在 ufw 中允许了端口,并在 postgresql 中设置了配置文件。但我也连接不上它。

如果我尝试使用telnet 连接到我的服务器的 5432 端口,它也会连接超时。

ufw 设置: ➜ ~ ufw 状态 状态:活跃

To                         Action      From
--                         ------      ----
80                         ALLOW       Anywhere
443                        ALLOW       Anywhere
22                         ALLOW       Anywhere
5432                       ALLOW       Anywhere
8000                       ALLOW       Anywhere
80 (v6)                    ALLOW       Anywhere (v6)
443 (v6)                   ALLOW       Anywhere (v6)
5432 (v6)                  ALLOW       Anywhere (v6)
22 (v6)                    ALLOW       Anywhere (v6)
8000 (v6)                  ALLOW       Anywhere (v6)

pg_hba:

local   all             postgres                                peer
host    all             all             all                     md5

postgresql.conf

listen_addresses = '*'
port = 5432

【问题讨论】:

  • 它看起来像是损坏的 pg_hba.conf - 缺少 IP 掩码
  • @PavelStehule 我试过了。但什么都没有改变。相同的配置可以在我的其他 Centos 系统上运行。但现在是 Ubuntu。
  • 你检查防火墙了吗
  • @PavelStehule 是的,我知道原因。我的 vps 提供商关闭了除 22 和 80 以外的所有端口

标签: postgresql ubuntu ufw


【解决方案1】:

我知道原因。 我的 VPS 提供商关闭了除 22 和 80 以外的所有端口

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-03-01
    • 2021-11-09
    • 2015-10-28
    • 1970-01-01
    • 2012-10-23
    • 2019-08-09
    • 1970-01-01
    • 2019-06-12
    相关资源
    最近更新 更多