Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bind multiple IP in mongoDb 4.x.x

for mongoDB 4.0.3, unable to add multiple ips in bindIp

following config works for localhost

net:
   port:27017
   bindIp:127.0.0.1

Following works for logging from other ip:

net:
       port:27017
       bindIp:0.0.0.0

following doesn't work

   bindIp:127.0.0.1 10.0.0.10
   bindIp:127.0.0.1,10.0.0.10
   bindIp:"127.0.0.1,10.0.0.10"
   bindIp:"127.0.0.1 10.0.0.10"
   bindIp:[127.0.0.1,10.0.0.10]
   bindIp:[127.0.0.1, 10.0.0.10]

any ip other than 0.0.0.0 or 127.0.0.1 gives error for bindIP

If I try following:

bindIp:10.0.0.10
ERROR: child process failed, exited with error number 48

this MongoDB Doc doesnt help

Any help will be appreciated.

like image 982
cartman619 Avatar asked Oct 25 '18 12:10

cartman619


1 Answers

Use ; I used in Mongo 4.2.2 version

 net:
   port: 27017
   bindIp: 127.0.0.1;10.0.1.149
like image 152
paul Avatar answered Sep 22 '22 20:09

paul