【发布时间】:2018-12-01 18:02:12
【问题描述】:
我在 AWS RDS 上创建了一个 postgres 数据库实例。我正在尝试将此数据库实例连接到我的 django zappa 应用程序,以便我可以执行 AWS Lambda 函数。
我已向我的数据库实例添加了一个新的安全组,因此我可以允许我的 django 应用程序连接到它:
我的数据库详细信息显示新的安全组处于活动状态:
但是,当我尝试通过终端运行psql --host="*************.us-east-2.rds.amazonaws.com" --port="5432" --username="*********" --password --dbname="*****" 来连接它时,
或者通过我的 pgadmin 界面,它返回这个错误:
psql: could not connect to server: Operation timed out
Is the server running on host "***********.us-east-2.rds.amazonaws.com" (18.191.94.44) and accepting
TCP/IP connections on port 5432?
知道为什么会这样吗?
【问题讨论】:
-
您的应用程序是否在同一个 VPC 中运行?
-
不知道你在问什么,但我的 zappa 应用程序是一个本地 django 项目,它正在尝试连接到 RDS 数据库。我正在按照本教程的说明进行操作:cloudacademy.com/blog/zappa-or-how-to-go-serverless-with-django
标签: python django database postgresql amazon-web-services