我正在尝试使用 Cloud SQL 代理将 GCE 实例连接到 Cloud SQL 实例(第二代)。当我 ssh 到 GCE 实例并且
sudo ./cloud_sql_proxy -dir=/cloudsql
我明白了
2016/07/13 18:59:28 Using gcloud's active project: xxxx-0000
2016/07/13 18:59:29 Error listing instances in xxxx-0000:
googleapi: Error 403: Access Not Configured.
Cloud SQL Administration API has not been used in project 000000000000
before or it is disabled. Enable it by visiting
https://console.developers.google.com/apis/api/sqladmin/overview?project=000000000000
then retry.
If you enabled this API recently, wait a few minutes for the action to
propagate to our systems and retry., accessNotConfigured
2016/07/13 18:59:29 no Cloud SQL Instances found in these projects: [xxxx-0000]
我遵循了
https://cloud.google.com/sql/docs/compute-engine-access#gce-connect-proxy和
https://cloud.google.com/sql/docs/sql-proxy上的文档
两个实例都在同一个项目中,并且 GCE 实例(加上默认实例)上启用了 Cloud SQL API。据我了解,默认 GCE 服务帐户应该能够对代理进行身份验证。
使用cloud_sql_proxy
with-instances
似乎有效,但accessNotConfigured
在尝试连接时也会出错。