MongoDB bind_ip won't work unless set to 0.0.0.0

后端 未结 12 834
遇见更好的自我
遇见更好的自我 2020-12-04 23:43

I really tried, even reinstall the MongoDB.

And it\'s the same to MongoDB bind_ip error: bind() failed errno:99 Cannot assign requested address for socket

It

12条回答
  •  生来不讨喜
    2020-12-05 00:38

    work for me for ubuntu 18 and the mongo --version 4.x.xx:

    1 - in etc/mongod.conf -net add

    bindIp: "127.0.0.1,0.0.0.0"

    2 - then use pm2:

    sudo apt-get update 
    
    sudo apt-get pm2
    

    3 - start the pm2 service to the mongod

    pm2 start mongod
    

    PD: you need to erase 0.0.0.0 in production scenario

提交回复
热议问题