![](/img/trans.png)
[英]"10.9.8.5", port 5433 failed: Connection timed out (0x0000274C/10060) Is the server running on that host and accepting TCP/IP connections?
[英]Heroku postgres: Connection timed out... TCP/IP connections on port 5432?
我正在制作一个新的电报机器人并想将其部署到 Heroku。我用它制作了一个 postgres 数据库(heroku)。 我以前使用 NordVPN,现在不使用了,我注意到在使用其他 VPN 时我无法再连接到我的数据库。 当我运行我的机器人(使用其他 VPN)时,我遇到了这个错误:
Exception: could not connect to server: Connection timed out (0x0000274C/10060)
Is the server running on host "ec2-18-211-41-246.compute-1.amazonaws.com" (18.211.41.246) and accepting
TCP/IP connections on port 5432?
不过没有 VPN 也能正常工作。 当我搜索时,这是因为防火墙。 但是我关闭了 windows 防火墙,也暂停了我的杀毒软件,仍然出现错误。 关于如何使其与任何 VPN 一起使用的任何建议?
一些信息:
>>> systeminfo
...
OS Name: Microsoft Windows 10 Home
OS Version: 10.0.19042 N/A Build 19042
...
>>> python --version
Python 3.8.0
>>> pip freeze | findstr psycopg2
psycopg2==2.8.6
>>> netstat -a -n | findstr "5432"
TCP 0.0.0.0:5432 0.0.0.0:0 LISTENING
TCP [::]:5432 [::]:0 LISTENING
>>> telnet 0.0.0.0 5432
Connecting To 0.0.0.0...Could not open connection to the host, on port 5432: Connect failed
>>> heroku version
heroku/7.54.1 win32-x64 node-v12.21.0
>>> heroku pg:info -a my-bot
=== DATABASE_URL
Plan: Hobby-dev
Status: Available
Connections: 0/20
PG Version: 13.3
Created: 2021-08-08 07:47 UTC
Data Size: 8.1 MB/1.00 GB (In compliance)
Tables: 1
Rows: 15/10000 (In compliance)
Fork/Follow: Unsupported
Rollback: Unsupported
Continuous Protection: Off
以上命令是在 VPN 连接下完成的
注意:电报在我的国家被封锁,所以为了能够编写电报机器人,我必须使用 VPN
我通过安装 OpenVPN 和使用 freeopenvpn 配置解决了我的问题。 我不知道这有什么帮助,但我把它留给以后发现这个问题的人
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.