2

I have 2 servers: One Ubuntu Server and a debian Server. I've installed Mongo DB and mongod will start, but when I try the command "mongo", I get the follow message:

MongoDB shell version: 2.4.9
connecting to: test
Tue Jun 28 19:01:21.922 Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:145
exception: connect failed

I start the MongoDB with this command:

clouduser@caridio-ubuntu-2:~$ sudo service mongodb start
sudo: unable to resolve host caridio-ubuntu-2
mongodb start/running, process 18555

I tried to set an other dbpath and to install an older version of MongoDB. I set up differnt servers. MQTT and Tomcat works both.

Here my config:

enter image description here

kommradHomer
  • 4,127
  • 5
  • 51
  • 68
Helge
  • 79
  • 3
  • 17

1 Answers1

0

it's an answer from 2 years ago

bindIP = [127.0.0.1,141.28.102.148]

so try to add your ips inside the [ ]

if you don't have others interface you can use bindIP = 0.0.0.0

source https://stackoverflow.com/a/34698336/6523542 maybe duplicate of ?? mongodb.conf bind_ip = 127.0.0.1 does not work but 0.0.0.0 works

Community
  • 1
  • 1
kiokoman
  • 1
  • 1
  • Thank you, but it doesn't work. I tried with [] and 0.0.0.0. It will connect to 127.0.0.1 every time – Helge Jun 28 '16 at 19:34
  • netstat -nl | grep 27017 what is it saying? you should also check your /etc/hosts file for this error -> sudo: unable to resolve host caridio-ubuntu-2 – kiokoman Jun 28 '16 at 20:27
  • I've installed Mongo DB and my girlfrind was watchen. I don't know why, but now it works. My next problem is the connection between the server and Robomongo. I had an user, the IP and a password. We get a connection (on Mac, but not on windows). The Authentification doesn't work. – Helge Jun 28 '16 at 23:02