Thursday 15 January 2015

mongodb - How to set mongod.conf bind_ip with multiple ip address -


I am a newbie to install server environment and mongoDB It really sounds a bit simple, though, I really need its help.

I am trying to connect to my virtual machine which runs the Mongodab example from the local machine, which I think is the production environment when I run it on a different remote server.

The environment is as follows:

  • Private IP for Virtual Machine: 1920.168 184.155

  • Public IP for both local machines and virtual machines: 96.88.169.145


< P> I changed bind_ip from /etc/mongod.conf file to

  Bind_ip = 127.0.0.1  

to

  bind_ip = 127.0.0.1,192.168.184.155 9 6.88.169.145  

After restarting the mongod service, Neither the virtual machine nor the local machine mongodb reach the mongodb through order Combed and can give me the following error.

  MongoDB shell version: 3.0.1 Connecting: Test 2015- 03-17T16: 02: 22.705-0400 Failed to connect to W Networks 127.0.0.170177, Reason: Error: 111 Connection Denied Done 2015-03-17T16: 02: 22.707-0400 E QUERY Error: Could not connect to server 127.0 0.1: 27017 (127.0.0.1), connection attempt (src / mongo / shell / mongo.js: 17 9: 14 Failed on connecting to: (connect): 1: 6 src / mongo / shell / mongo.js: 179 exception: connecting failed  

However, if I

 < Change the code> bind_ip = 192.168.184.155  

and restart service, this Is in and I can use Mongo from your local machine. It seems that many IP addresses do not work with. I tried to see in the Mongodb document, however, they mention that bind_ip takes a comma separated list, which actually confuses me.

Thank you for your help in advance.

Wrap separately from coma - wrap the Ips with brackets that work for me in 3.2.7: / P>

  BindIp = [127.0.0.1, 1982.168.184.155, 96.88.169.145]  

No comments:

Post a Comment