来自App Engine的云SQL(灵活环境)连接问题 [英] Cloud SQL from App Engine (flexible environment) connection issue

查看:112
本文介绍了来自App Engine的云SQL(灵活环境)连接问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试从我的App Engine灵活环境NodeJS应用程序访问我的Cloud SQL实例,但不断收到超时问题。



当我添加计算机的IP引擎将App引擎运行到它的云端SQL访问控制。该文件指出,如果两者都在同一个项目中,应自动授予访问权。



我缺少什么?



我为knex使用以下连接设置:

  const config = {
host:'myIP' ,
user:'user',
password:'password',
database:'database',
port:3306
};

套接字设置也不起作用。抛出一个未处理的拒绝错误:连接ENOENT / cloudsql异常:

  const config = {
socketPath:'/ cloudsql / project:zone:instance',
user:'user',
password:'password',
database:'database'
};


解决方案

这个错误很可能表示代理进程不是运行在GAE Flexible实例上。

根据 documentation ,您必须在 app.yaml中设置 cloud_sql_instances 文件让代理自动启动。


I'm trying to access my Cloud SQL instance from my App Engine flexible environment NodeJS application but kept getting timeout issues.

When I add the IP of the compute engine running the App engine to the Cloud SQL Access Control it works. The documentation states that access should be granted automatically if both are in the same project.

What am I missing?

I'm using the following connection settings for knex:

const config = {
    host: 'myIP',
    user: 'user',
    password: 'password',
    database: 'database',
    port: 3306
  };

The socket settings aren't working either. throwing a "Unhandled rejection Error: connect ENOENT /cloudsql" exception:

const config = {
    socketPath: '/cloudsql/project:zone:instance',
    user: 'user',
    password: 'password',
    database: 'database'
  };

解决方案

This error most likely indicates that the proxy process is not running on the GAE Flexible instance.

As per the documentation, you must have cloud_sql_instances set in your app.yaml file for the proxy to be automatically started.

这篇关于来自App Engine的云SQL(灵活环境)连接问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆