Mongod How to bindIp to multiple ports in a config file

546 views
Skip to first unread message

rss81

unread,
Dec 8, 2017, 6:57:15 PM12/8/17
to mongodb-user
Hi,

I have the following config file:


net:
  bindIp: 127.0.0.1
  port: 27017
  
storage:
  dbPath: c:\mongoDATA\db
  journal:
    enabled: true
    
##systemLog:
 ## destination: file
 ## path: C:\mongoDATA\log\mongodb.log   
 ## logAppend: trueEnter code here...


this works, but when I try to add multiple ports like:

bindIp: 127.0.0.1, 192.168.10,115
or
bindIp: "127.0.0.1, 192.168.10,115"
or
bindIp: [127.0.0.1, 192.168.10,115]

with or without the space after the comma it doesn't.  Could someone provide the write syntax?  Thanks




Rhys Campbell

unread,
Dec 9, 2017, 9:14:49 AM12/9/17
to mongodb-user
You mean ip address rather than port. Set to 0.0.0.0 to bind to all available interfaces.

rss81

unread,
Dec 9, 2017, 4:36:28 PM12/9/17
to mongodb-user
the correct form is:

    bindIp:  "127.0.0.1,192.168.1.6"

the problem was the IP address needs to be there 
Reply all
Reply to author
Forward
0 new messages