0

I have an Ubuntu VM in Google cloud which is having my Mongo Instance running.

  1. I have enabled authentication
  2. Mongo config is configured to bind for the 127.0.0.1 and the internal IP of the server.
  3. In google console I've the 27107 TCP port opened.
  4. The port is open in the VM too.
  5. But when i try to connect to the Mongo instance using the internal IP of the server from a Node JS App Service I'm getting an error as shown below. any idea why is that?

    failed to connect to server [:27017] on first connect [MongoError: connection 0 to :27017 timed out]' }

I'm also able to connect to server using mongo shell using the google cloud console.

Aneef
  • 113
  • 3

1 Answers1

3

Seems you are connecting from App Engine to GCP, you have to configure VPC to do that. Detailed here: https://cloud.google.com/vpc/docs/configure-serverless-vpc-access