当我试图连接到我的cloudsql实例时,我得到了这样的错误信息
{
errorno: "ETIMEDOUT",
code: "ETIMEDOUT",
syscall: "connect",
fatal: true
}
这是来自我的cloudsqlproxy容器的日志。
2020/06/09 15:53:04 current FDs rlimit set to 1048576, wanted limit is 8500. Nothing to do here.
2020/06/09 15:53:04 using credential file for authentication; [email protected]
2020/06/09 15:53:04 Listening on 127.0.0.1:3306 for estatelion-test-275318:us-central1:estatelion
2020/06/09 15:53:04 Ready for new connections
但我的nodejs应用却无法连接到它。
const connection = mysql.createPool({
connectionLimit: 10,
host: config.get("database").host, // localhost
user: config.get("database").user, // cloud proxy user for my cloudsql instance
password: config.get("database").password, // password
database: config.get("database").db_name, // database
});
好吧,我找到了解决这个问题的办法,我只是更新了集群版本到1.15.11-gke.15从1.14.*(我不记得其余的),它的工作正常。
我想是默认的GKE版本的部署出现了一些bug。
谢谢大家的时间和努力。 :-)