How to set mongod.conf bind_ip with multiple ip address

前端 未结 16 616
情书的邮戳
情书的邮戳 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条回答
  •  半阙折子戏
    2020-12-09 02:06

    The bindIp rule with comma separated IP addresses is only meant for known ethernet interfaces, or for the 0.0.0.0 and 127.0.0.1 rules. You can only use the ip addresses of your system's Network Interface Cards. If this list contains an unknown IP address, i.e. an IP of another system, your MongoDb instance will not restart and hence you're not able to connect. To check if your MongoDb instance is running, run the following:

    $ sudo systemctl status mongod
    

    If you would like to make your MongoDb instance available to other systems on your network, you'll want to bind the local IP associated with the private network. To determine network interface configuration easily, just run an ifconfig from the command line:

    $ ifconfig
    

    This will list all available IP addresses that you can use in the bindIp rule. Most certainly, the IP address 96.88.169.145 that you use is not a valid IP address or unknown by your system.

提交回复
热议问题