-1

I have created one EC2 instance of Windows Server 2012 R2.

I have installed MongoDB on that server.

I setup an inbound rule to allow port 27017 to connect to MongoDb from my local machine.

Now I am trying to connect using MongoDB GUI tool (MongoBooster) and its giving following error.

{
"message" : "connect ETIMEDOUT X.X.X.X:27017",
"name" : "MongoError",
"stack" : "Error: connect ETIMEDOUT X.X.X.X:2701" +
          "at Object.exports._errnoException (util.js:949:11" +
          "at exports._exceptionWithHostPort (util.js:972:20" +
          "at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1080:14)"
}

How can I resolve this issue?

TylerH
  • 20,799
  • 66
  • 75
  • 101
Jignesh Patel
  • 189
  • 1
  • 16
  • 1
    Have you modified the `bind_ip` setting as described here? http://stackoverflow.com/questions/30884021/mongodb-bind-ip-wont-work-unless-set-to-0-0-0-0 – Mark B Jun 17 '16 at 15:38
  • @MarkB, The solution you provided was for linux system. How can I do that for windows server? – Jignesh Patel Jun 22 '16 at 10:09

1 Answers1

3

For adding config file (mongodb.conf), You need to create one file with .conf extension. And add below configuration in this file:

dbpath = c:\data\db
port = 27017
bind_ip = 0.0.0.0
logpath = c:\data\logs\mongoconf.log

And Start Command prompt as Administrator. And change directory to your mongo bin directory C:\mongodb\bin and run below command

mongod -config c:\mongodb\config\mongodb.conf

And please check your firewall is off or you can set appropriate settings in Firewall also.

Pavan V Parekh
  • 1,906
  • 2
  • 19
  • 36
  • 1
    Thank you very much, I have done above settings and also I needed to turn off the firewall to connect it over internet. And it just worked. Can we do it by doing firewall on? – Jignesh Patel Jun 24 '16 at 07:07
  • 2
    Yes, You can do it with firewall on. You just need to set inbound rules in Firewall Advance Settings for predefined rule "World Wide Web Services (HTTP Traffic-In)" and also set rules for Port 27017. – Pavan V Parekh Jun 24 '16 at 13:21