Google Cloud Platform - Can't connect to mongodb

后端 未结 5 1173
夕颜
夕颜 2020-12-20 14:53

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

5条回答
  •  没有蜡笔的小新
    2020-12-20 15:16

    This answer explains how to set the firewall rule for port 27017.

    Another issue that could cause this is running your mongodb in a separate network and having your other instances on the default network (or vice versa).

    I ran into this and after getting both instances on the same network, it was able to connect to the mongo instance by name.

    Here's an example of how to set the network for a managed VM in your app.yaml:

    network:
      instance_tag: https-server
      name: my-node-network
    

提交回复
热议问题