红联Linux门户
Linux帮助

Ubuntu 15.10安装mongodb

发布时间:2016-01-25 09:32:42来源:linux网站作者:薛定谔的死猫

首先按照官方文档:https://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/

sudo service mongod start

在执行启动服务时会报错——

Failed to start mongod.service: Unit mongod.service failed to load: No such file or directory.


解决方法在这里:

http://askubuntu.com/questions/690993/mongodb-3-0-2-wont-start-after-upgrading-to-ubuntu-15-10

Create a file /lib/systemd/system/mongodb.service with the following content:

[Unit]
Description=High-performance, schema-free document-oriented database
After=network.target

[Service]
User=mongodb
ExecStart=/usr/bin/mongod –quiet –config /etc/mongod.conf

[Install]
WantedBy=multi-user.target

注意,/etc/mongod.conf是配置文件,原文是mongodb.conf,根据自己的情况修改。


问题原因:

在刚才帖子下方有人解释了——

This error occurred due to the problem with the new Ubuntu (15 and ahead).

Default init system is systemd which was Upstart previously.


本文永久更新地址:http://www.linuxdiyf.com/linux/17643.html