【问题标题】:unable to connect to Azure Postgres from Azure aks无法从 Azure aks 连接到 Azure Postgres
【发布时间】:2021-09-11 00:30:13
【问题描述】:
postgres@name-prod-psql-197fb74f68-9psrh:/$ psql "host=name-prod.postgres.database.azure.com port=5432 dbname=prod user=user password=XXX"

psql: error: could not connect to server: Connection timed out
    Is the server running on host "name-prod.postgres.database.azure.com" (10.110.0.4) and accepting
    TCP/IP connections on port 5432?

如果我在 POD 内运行 traceroute

[root@utils /]# traceroute name-prod.postgres.database.azure.com
traceroute to name-prod.postgres.database.azure.com (10.110.0.4), 30 hops max, 60 byte packets
 1  10-240-0-226.prometheus-node-exporter.prometheus.svc.cluster.local (10.240.0.226)  0.037 ms  0.019 ms  0.009 ms
 2  * * *
 3  * * *
 4  * * *
 5  * * *
 6  * * *
 7  * * *
 8  * * *
 9  * * *
10  * * *
11  * * *
12  * * *
13  * * *
14  * * *
15  * * *
16  * * *
17  * * *
18  * * *
19  * * *
20  * * *
21  * * *
22  * * *
23  * * *
24  * * *
25  * * *
26  * * *
27  * * *
28  * * *
29  * * *
30  * * *

以前可以工作8天,然后突然停止。

  • Postgres 位于子网 10.110.0.0/16
  • 在prod-private-eks 10.240.0.0/16 中添加了Microsoft.Sql 服务端点

可能是什么问题?

【问题讨论】:

标签: azure azure-aks azure-virtual-network azure-postgresql


【解决方案1】:

如果没有的话,建议你为 PostgreSQL 打开一个防火墙端口

请参阅此文档以了解如何在 Windows Defender 防火墙中打开端口:

https://manifold.net/doc/mfd9/open_a_firewall_port_for_postgresql.htm

在 PostgreSQL 的情况下,如果可用,通常使用端口 5432。如果不是,大多数安装程序会选择下一个空闲端口,通常是 5433。

参考:postgresql port confusion 5433 or 5432?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-11-17
    • 2019-06-26
    • 1970-01-01
    • 2016-01-17
    • 1970-01-01
    • 2023-03-12
    • 1970-01-01
    • 2022-01-13
    相关资源
    最近更新 更多