connecting to mongodb instance through the firewall

215 views
Skip to first unread message

pankaj kumar

unread,
Apr 14, 2016, 4:36:45 AM4/14/16
to Google App Engine
I am trying to open the mongodb instance I created using the compute engine cloud launcher so that I can access it from anywhere. I did the following but it does not seem to work. Can you help?
 

# gcloud config set project my-project
# gcloud compute firewall-rules create allow-mongo --description "Incoming mongo allowed." --source-tags=mongo-arbiter --allow tcp:27017
Created [allow-mongo].
NAME        NETWORK SRC_RANGES RULES     SRC_TAGS            TARGET_TAGS
allow-mongo default            tcp:27017 mongo-arbiter
# gcloud compute firewall-rules create allow-mongo-server --description "Incoming mongo allowed." --source-tags=mongodb-1-server-1 --allow tcp:27017
Created [allow-mongo-server].
NAME               NETWORK SRC_RANGES RULES     SRC_TAGS           TARGET_TAGS
allow-mongo-server default            tcp:27017 mongodb-server


Reset the database servers from the console. But still "telnet <ip> 27017" does not seem to work. Can you please help?

Thanks

Nick (Cloud Platform Support)

unread,
Apr 14, 2016, 3:27:47 PM4/14/16
to Google App Engine
Hey Pankaj,

This type of question - a specific issue technical support request - should be posted to a Stack Exchange site like stackoverflow.com. This forum is meant more for general and high-level discussion of the platform. However, I'll be happy to assist you here. Some questions which should be asked at this point:

* Where are you connecting from with telnet?
* Can you SSH into the instance and ensure that it's listening on 27017 with "sudo netstat -plant"?
* Are you perhaps confusing "source-tags" with "target-tags" when you create the firewall rules?

Feel free to include any questions you may have in your reply.

Best wishes,

Nick
Cloud Platform Community Support

pankaj kumar

unread,
Apr 14, 2016, 5:04:45 PM4/14/16
to Google App Engine
Hi Nick,

* I am connecting from my home computer
* It is listening on 27017 and funnily there is an established connection from 10.128.0.5
* I tried both but it does not seem to work with target tags as well.

Thanks for your response. I also posted the question on stack overflow if you prefer to answer there: http://stackoverflow.com/questions/36633962/connecting-to-mongodb-instance-on-google-app-engine

Thanks

Nick (Cloud Platform Support)

unread,
Apr 14, 2016, 5:29:29 PM4/14/16
to Google App Engine
Thanks for replying. I'll reply there.
Reply all
Reply to author
Forward
0 new messages