我正在尝试为Ubuntu 14.04安装Mongodb。我从这里开始关注Mongodb安装的官方文档 - https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/
我运行了以下命令: -
当我执行命令#4时,我接近输出的结尾:
Setting up mongodb-org-server (3.6.3) ...
runlevel:/var/run/utmp: No such file or directory
invoke-rc.d: policy-rc.d denied execution of start.
initctl: Unknown job: mongod
Setting up mongodb-org-mongos (3.6.3) ...
Setting up mongodb-org-tools (3.6.3) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up mongodb-org (3.6.3) ...
在此之后,当我运行sudo service mongod start
时,我得到了:
start: Unknown job: mongod
运行mongo
会导致: -
MongoDB shell version v3.6.3
connecting to: mongodb://127.0.0.1:27017
2018-03-30T12:45:43.635+0530 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused
2018-03-30T12:45:43.635+0530 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
connect@src/mongo/shell/mongo.js:251:13
@(connect):1:6
exception: connect failed
mongo --version
会导致: -
MongoDB shell version v3.6.3
git version: 9586e557d54ef70f9ca4b43c26892cd55257e1a5
OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014
allocator: tcmalloc
modules: none
build environment:
distmod: ubuntu1404
distarch: x86_64
target_arch: x86_64
/var/log/mongodb
和/var/lib/mongodb
都是空文件夹。
我已使用上面链接的相同文档页面上的说明卸载了这个,并重新安装了它。没有变化。
无法相信官方指示失败,我无法在任何地方找到解决方案。