3
votes

Having a bit of trouble with this. Trying out Google Cloud at the moment and cant my GCloud Postgres db to link to my app engine app.

I'm following everything here :

https://cloud.google.com/appengine/docs/flexible/nodejs/using-cloud-sql-postgres

However, when I try to run the createTables.js process I get the following issue:

Failed to create 'visits' table: { Error: connect ECONNREFUSED 127.0.0.1:5432
    at Object._errnoException (util.js:1026:11)
    at _exceptionWithHostPort (util.js:1049:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1174:14)
  code: 'ECONNREFUSED',
  errno: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 5432 }

Databases aren't really my strong point so I'm a bit stumped.

These are both running in the same GCloud Project also.

Let me know if you need me to supply any more info (not sure exactly what is useful)

Cheers,

Jay

1
were you able to solve this problem? - Ziyaddin Sadigov

1 Answers

0
votes

To establish a connection between Google Cloud Postgres and App Engine, try these steps:

  • Enable the API

  • Install the proxy client on your local machine

  • Decide who will authenticate the proxy

  • Create a service account, in case your authentication method demands it

  • Decide how you will specify instances for your proxy

  • Start the proxy

  • Update your app and connect it to Googe Cloud Postgres