【问题标题】:PostgreSQL: could not translate host name: <address> to address: Temporary failure in name resolutionPostgreSQL:无法将主机名:<地址> 转换为地址:名称解析暂时失败
【发布时间】:2020-08-25 11:11:45
【问题描述】:

我正在尝试将 postgre db 从 DO VM 迁移到 DO 的 PostgreSQL 托管数据库中。

我使用pg_dump 用于特定数据库,并使用pg_restore 加载数据。

一切顺利,除非我关闭旧虚拟机,从新托管数据库中查询数据导致

could not translate host name: <address> to address: Temporary failure in name resolution

而如果从我关闭的虚拟机查询,会导致预期的结果,

could not connect to server: Connection timed out

令人困惑的是,如果我重新打开 VM,托管数据库可以正常工作。

我正在使用下面的命令转储数据库,

pg_dump -h <> -U <> -p <> -Fc <> > <>.bak

要恢复,

psql -d  <connection-string> -f <>.bak

是防火墙问题,还是我对 DO 的托管数据库有误解?

我读过https://www.digitalocean.com/docs/databases/postgresql/resources/troubleshoot-connections/#could-not-translate-hostname-to-address,主机名没有问题,因为如果虚拟机打开,我可以提取数据。

【问题讨论】:

    标签: postgresql digital-ocean


    【解决方案1】:

    经过研究,Temporary failure in name resolution 是 DNS 中配置错误的常见问题,并通过查看 /etc/resolv.conf 进行修复。

    【讨论】:

    • 你能说得更具体点吗?您实际上对 /etc/resolv.conf 文件做了什么?
    • 这真是一个无益于帮助的答案。你能说一下你实际做了什么来修复它吗?
    猜你喜欢
    • 2021-10-03
    • 1970-01-01
    • 1970-01-01
    • 2020-12-30
    • 2013-01-29
    • 1970-01-01
    • 1970-01-01
    • 2011-03-12
    • 1970-01-01
    相关资源
    最近更新 更多