Just installed mongodb using click-to-deploy in google cloud platform. I have another project, for which I created the mongodb database, where my web application runs. Do I
As the other answers in this thread suggest, mongod
daemon is listening on TCP port 27017
. Therefore, you will need to add a firewall rule on Compute Engine firewall for this port and protocol. This can be done using Google Cloud console or using gcloud
command tool:
gcloud compute firewall-rules create allow-mongodb --allow tcp:27017
It is recommended to use target tag with the firewall rule and use this target tag to specify what VM instances the firewall rule should be applied to.