使用Node.js在GCloud Postgres SQL中进行连接

时间:2018-07-20 18:34:05

标签: node.js postgresql google-cloud-platform google-cloud-sql

我目前正受到GCP的殴打

我的GCP中有两个项目。第一个有一个Postgresql实例。第二个有一个我想在第一个项目的postgres中连接到的nodejs环境。

但是,我无法连接。我收到很多错误。在https://console.developers.google.com/apis/api/sqladmin/overview中,可以看到以下示例:

2018-07-20 15:05:02.000 BRT
googleapi: Error 403: The client is not authorized to make this request., notAuthorized
{
 insertId:  "1vzsx8tf1jtki8"  
 labels: {…}  
 logName:  "projects/project-id-of-second-instance/logs/appengine.googleapis.com%2Fstderr"  
 receiveTimestamp:  "2018-07-20T18:05:37.273520497Z"  
 resource: {…}  
 textPayload:  "    googleapi: Error 403: The client is not authorized to make this request., notAuthorized
"  
 timestamp:  "2018-07-20T18:05:02Z"  
}

2018-07-20 15:12:37.000 BRT
{ Error: connect ENOENT /cloudsql/project-id-of-first-instance:us-central1:data-base/.s.PGSQL.5432 at Object._errnoException (util.js:992:11) at _exceptionWithHostPort (util.js:1014:20) at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)
 {
 insertId:  "epf1xrg1bzoqkb"  
 labels: {…}  
 logName:  "projects/project-id-of-second-instance/logs/appengine.googleapis.com%2Fstdout"  
 receiveTimestamp:  "2018-07-20T18:12:40.285974486Z"  
 resource: {…}  
 textPayload:  "{ Error: connect ENOENT /cloudsql/project-id-of-first-instance:us-central1:data-base/.s.PGSQL.5432
    at Object._errnoException (util.js:992:11)
    at _exceptionWithHostPort (util.js:1014:20)
    at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)
"  
 timestamp:  "2018-07-20T18:12:37Z"  
}

0 个答案:

没有答案
相关问题