Hi Jeroen,
Can someone please help me with the following problem: http://stackoverflow.com/q/37857270/4735131 ??
I can replicate the error message you saw if I tried to bind to an IP address that is not my machine’s. For example, my machine’s IP address is 10.0.2.15
. If I try to intentionally bind to a wrong address:
2016-06-30T12:44:31.387+1000 I CONTROL [initandlisten] options: { config: "mongod.conf", net: { bindIp: "127.0.0.1,10.0.2.10" }, storage: { dbPath: "." } }
2016-06-30T12:44:31.408+1000 E NETWORK [initandlisten] listen(): bind() failed errno:99 Cannot assign requested address for socket: 10.0.2.10:27017
2016-06-30T12:44:31.408+1000 E STORAGE [initandlisten] Failed to set up sockets during startup.
2016-06-30T12:44:31.409+1000 I CONTROL [initandlisten] dbexit: rc: 48
Which is identical to the error message you posted. However using the correct IP address works as expected:
2016-06-30T12:44:17.158+1000 I CONTROL [initandlisten] options: { config: "mongod.conf", net: { bindIp: "127.0.0.1,10.0.2.15" }, storage: { dbPath: "." } }
(...)
2016-06-30T12:44:17.256+1000 I NETWORK [initandlisten] waiting for connections on port 27017
Are you absolutely certain that 192.168.2.1
is your machine’s IP address? You can check by running the command ifconfig | grep inet
, e.g.:
$ ifconfig | grep inet
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe09:d1cc/64 Scope:Link
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
Please note that the bindIp configuration for multiple address requires them to be comma separated values.
If you are still having issues, could you post:
mongod.conf
config file (should be /etc/mongod.conf
in your case)Best regards,
Kevin