How to set mongod.conf bind_ip with multiple ip address

前端 未结 16 593
情书的邮戳
情书的邮戳 2020-12-09 01:22

I am a newbie for setting up the server environment and mongoDB. This may sounds something really simple, however, I really need your help on it.

I am trying to conn

16条回答
  •  Happy的楠姐
    2020-12-09 02:18

    With the following version of MongoDB: MongoDB shell version v3.6.10

    Reproducing Problem: When [127.0.0.1,xxx.xxx.xxx.xxx] is used we get the following error. Scalar option 'net.bindIp' must be a single value try 'mongod --help' for more information

    Analysis This is because, according to MongoDB Documentation: https://docs.mongodb.com/manual/reference/configuration-options/#net.bindIP

    net.bindIP is of type "string".

    Solution for binding multiple IP Addresses

    bindIp: "127.0.0.1,xxx.xxx.xxx.xxx"
    

    Note: No spaces after commas

提交回复
热议问题