mongo - couldn't connect to server 127.0.0.1:27017

后端 未结 30 2406
故里飘歌
故里飘歌 2020-11-27 09:43

I am coming from riak and redis where I never had an issue with this services starting, or to interact.

This is a pervasive problem with mongo and am rather clueless

30条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-27 10:45

    Another solution that resolved this same error for me, though this one might only be if you are accessing mongo (locally) via a SSH connection via a virtual machine (at least that's my setup), and may be a linux specific environment variable issue:

    export LC_ALL=C
    

    Also, I have had more success running mongo as a daemon service then with sudo service start, my understanding is this uses command line arguments rather then the config file so it likely is an issue with my config file:

    mongod --fork --logpath /var/log/mongodb.log --auth --port 27017 --dbpath /var/lib/mongodb/admin
    

提交回复
热议问题