我正在尝试在 ubuntu 16.10 上安装 mongodb,尽管它没有在支持的版本中列出。我首先在尝试启动 mongo shell 时遇到此错误:
MongoDB shell version v4.0.0
connecting to: mongodb://127.0.0.1:27017
2018-07-12T11:15:00.464+0200 E QUERY [js] Error: couldn't connect
to server 127.0.0.1:27017, connection attempt failed: SocketException:
Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused
:
connect@src/mongo/shell/mongo.js:251:13
@(connect):1:6
exception: connect failed
我尝试运行sudo service mongod start
但我得到了Unit mongod.service not found.
我也尝试修改 mongodb.service 文件,检查锁定文件,运行修复命令并重新安装 mongo。
在 中的指定位置找不到日志文件mongod.conf
,在 中没有mongodb
目录/var/log
。