문제

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: true

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 (using 3.6 community)

도움이 되었습니까?

해결책

without a space after the comma, AND the ip address has to present

다른 팁

@DCR, Wrap the comma-separated-Ips with brackets.

For example suppose that we have multiple ips like (192.168.10.115,96.88.169.145) and loop back ip(127.0.0.1) then the binding syntax will be as mention below

bindIp = [127.0.0.1, 192.168.10.115, 96.88.169.145]

For further your ref Fix bindIp multiple address notation in Configuration Options, Here,Here and How to set mongod.conf bind_ip with multiple ip address

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 dba.stackexchange
scroll top