Connecting to my MongoDB Instance

1,598 views
Skip to first unread message

Satish B

unread,
Mar 16, 2015, 4:15:11 PM3/16/15
to gce-dis...@googlegroups.com
Hi guys,

I've installed MongoDB on GCP. It has a external IP.

I also have a node.js server at AWS, which uses Mongoose to connect to MongoDB.

I am not able to connect to MongoDB installed on GCP.

What's the connection string I need to enter for Mongoose?

I tried with MongoDB instances External IP, but it did not work :(

If 127.234.6.123 is the external IP, then whats the connection string?

I also have a elastic IP for my Node instance on aws.

Please help ..

Xavier Sanchez

unread,
Mar 16, 2015, 4:53:22 PM3/16/15
to Satish B, gce-dis...@googlegroups.com

Hello Satish,

It coul be a stupid question but...Are you open 27017 port (or the one that you configure) on GC firewall and also add this to instance?

I did this error my first time.

Regards

Xavi

El dia 16/03/2015 21.15, "Satish B" <technotip...@gmail.com> va escriure:
--
© 2014 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043
 
Email preferences: You received this email because you signed up for the Google Compute Engine Discussion Google Group (gce-dis...@googlegroups.com) to participate in discussions with other members of the Google Compute Engine community and the Google Compute Engine Team.
---
You received this message because you are subscribed to the Google Groups "gce-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gce-discussio...@googlegroups.com.
To post to this group, send email to gce-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gce-discussion/93062327-15b2-46aa-847e-bbe7e2b4391b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Satish B

unread,
Mar 18, 2015, 6:42:14 AM3/18/15
to gce-dis...@googlegroups.com
Finally was able to do it :) Thanks for the help ..

Amit Srivastava

unread,
Jul 16, 2015, 11:57:06 PM7/16/15
to gce-dis...@googlegroups.com
I was using this connections string; "

mongodb://123.456.150.134:27017/test



Bu tmy connection still fails from my laptop, It also fails from my NOEJS on Gogle compute engine instance, what else does need to be done?

Patrice

unread,
Jul 17, 2015, 1:52:07 PM7/17/15
to gce-dis...@googlegroups.com, mra...@gmail.com
Hi all!

First, Satish, happy that you found your solution.

Amit, I will take your other thread you started and forward it to the Google Compute Engine discussion group, where you'll have more specialized help :)

Cheers!

Amit Srivastava

unread,
Jul 17, 2015, 2:37:00 PM7/17/15
to gce-dis...@googlegroups.com
I was able to resoleve the problem. The GCE mongodb document does not talk abou thtis. But one needs to open the port for the firewall with the following command:


gcloud compute firewall-rules create mongodb --allow tcp:27017

-amit

--
© 2014 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043
 
Email preferences: You received this email because you signed up for the Google Compute Engine Discussion Google Group (gce-dis...@googlegroups.com) to participate in discussions with other members of the Google Compute Engine community and the Google Compute Engine Team.
---
You received this message because you are subscribed to a topic in the Google Groups "gce-discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gce-discussion/2KhQiF2y6O8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gce-discussio...@googlegroups.com.

To post to this group, send email to gce-dis...@googlegroups.com.

metrri jain

unread,
Feb 19, 2018, 11:41:24 AM2/19/18
to gce-discussion
Hi, 
I have a similar issue, I created a MongoDB cluster via cloud launcher on GCP, I have an external IP. 
I also created a firewall rule to open tcp:27017 on mongo db server to allow ingress from all sources. I am still not able to connect.
I checked on the server, it is listening on port 27017. 
Reply all
Reply to author
Forward
0 new messages