how to set Mongod config set multiple bindIp addresses
-
10-10-2020 - |
Question
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)
La solution
without a space after the comma, AND the ip address has to present
Autres conseils
@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
Licencié sous: CC-BY-SA avec attribution
Non affilié à dba.stackexchange