The problem is this: I created a virtual machine on portal.azure.com (HPC Pack 2012 R2 on Windows Server 2012 R2), after which I put MongoDB in there, created a database, a collection. But when I try to get access to the server on my home PC, nothing happens (from the ASP.NET MVC layout). I read that you need to somehow add to the IP address configuration file, or via bind_ip, but for some reason it is not possible to do this. I do not know what to do, help who can.

  • bind_ip = 0.0.0.0 tried to insert into the Mongo configuration? - Firepro
  • how to do it? - AndrijM
  • In the folder with mongodb there should be some configuration file .cfg or .conf, something like that. There you need one line in which it already costs 127.0.0.1 to be replaced by 0.0.0.0, if it is there. - Firepro
  • There is no such file (I searched in C: \ Program Files \ MongoDB \ Server \ 3.2 \ bin - here I installed MongoDB). Maybe somewhere else maybe? - AndrijM

1 answer 1

  1. Specify in the configuration file mongod.cfg

    bindIp: 0.0.0.0

  2. Restart MongoDB

  3. Check / Open port 27017 on the server firewall.

PS: It is recommended to open the port only for the specified IP, otherwise the database will be open for public access.

  • Well, do not forget to put the password on the base, especially since it will stick out - Vladimir Gamalyan