【发布时间】:2019-07-18 00:08:06
【问题描述】:
我无法在 GCP 中连接到 Cloud SQL, 我的 Spring Boot 应用程序托管在 Google Kubernetes 中, 我能够将我的应用程序从本地连接到数据库 但是当我在 kubernetes 中部署我的应用程序映像时它不起作用 我检查了日志并得到了这个
{
insertId: "s=5ae000c9c858402ba514b2f9a2a7d34d;i=557f; b=fef2848a05ed422b811cda756eea59d6;m=2a5164d50;t=58dde1640752b; x=4a97c620c9fbf136-0@aa"
logName: "projects/finomatic /logs/cloudsql.googleapis.com%2Fmysql.err"
receiveTimestamp: "2019-07-17T10:38:04.977705316Z"
resource: {…}
severity: "INFO"
textPayload: "2019-07-17T10:37:59.135897Z 1340 [Note] Aborted connection 1340 to db: 'finomatic' user: 'root' host: ' cloudsqlproxy~129.41.84.82' (Got an error reading communication packets)"
timestamp: "2019-07-17T10:37:59.136950Z"
}
所以我在 sql Connection 选项卡中添加了我的集群 IP,但仍然收到此错误
当我只是预览我的应用程序泊坞窗图像时,我的 API 工作正常
部署后 api 不起作用
部署后出现此错误
Could not open JPA EntityManager for transaction; nested exception is org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection
【问题讨论】:
标签: sql kubernetes google-cloud-platform