Cloud SQL from App Engine (flexible environment) connection issue

时光毁灭记忆、已成空白 提交于 2019-12-11 04:59:46

问题


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'
  };

回答1:


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.



来源:https://stackoverflow.com/questions/45709319/cloud-sql-from-app-engine-flexible-environment-connection-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!