【发布时间】: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,主机名没有问题,因为如果虚拟机打开,我可以提取数据。
【问题讨论】: