我对 Google Cloud 和运行应用程序很陌生。我目前有一个 Django 应用程序在 Google 灵活应用引擎上的 Docker 容器中运行,该应用程序连接到同一项目中的 Google Cloud SQL (PostgreSQL) 实例。最新版本已经运行了大约 3 天没有问题。
今天我开始OperationalError: server closed the connection unexpectedly从应用程序中反复收到错误。我可以运行 Cloud SQL 代理并正常启动 ( Ready for new connections),但是如果我尝试与 psql 连接,则会收到错误消息:
psql: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
Run Code Online (Sandbox Code Playgroud)
代理报告:
couldn't connect to "<instance_name>:us-central1:<instance_name>":
dial tcp <ip address>:3307: connect: connection refused
Run Code Online (Sandbox Code Playgroud)
在通过 SSH 连接到我正在运行的 flex 应用程序实例并运行时sudo docker logs <cloud proxy container>,最后几行类似: …
google-app-engine google-cloud-sql cloud-sql-proxy app-engine-flexible