Mongodb 无法在 Ubuntu 15.04 中启动 [英] Mongodb not able to start in Ubuntu 15.04
问题描述
我已使用以下命令在 Ubuntu 15.04 中安装了 MongoDB 3.0.6.
I have installed MongoDB 3.0.6 in Ubuntu 15.04 using the following commands.
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org
最后在安装过程中我得到了这个:
In the end in the installation process I got this:
Job for mongod.service failed. See "systemctl status mongod.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mongod, action "start" failed.
dpkg: error processing package mongodb-org-server (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up mongodb-org-mongos (3.0.6) ...
Setting up mongodb-org-tools (3.0.6) ...
dpkg: dependency problems prevent configuration of mongodb-org:
mongodb-org depends on mongodb-org-server; however:
Package mongodb-org-server is not configured yet.
dpkg: error processing package mongodb-org (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Processing triggers for systemd (219-7ubuntu6) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
mongodb-org-server
mongodb-org
E: Sub-process /usr/bin/dpkg returned an error code (1)
之后,当我使用以下命令启动服务器时,出现错误并且服务器未启动.
After that when I start the server using the below command I get an error and the server is not started.
sudo service mongod start
错误是
Job for mongod.service failed. See "systemctl status mongod.service" and "journalctl -xe" for details.
现在当我跑步时:
sudo systemctl status mongod.service
我得到以下信息:
mongod.service - LSB: An object/document-oriented database
Loaded: loaded (/etc/init.d/mongod)
Active: failed (Result: exit-code) since Thu 2015-10-08 13:46:08 IST; 22s ago
Docs: man:systemd-sysv-generator(8)
Process: 6604 ExecStart=/etc/init.d/mongod start (code=exited, status=1/FAILURE)
Oct 08 13:46:07 gariya-GA-A55M systemd[1]: Starting LSB: An object/document-oriented database...
Oct 08 13:46:07 gariya-GA-A55M mongod[6604]: * Starting database mongod
Oct 08 13:46:08 gariya-GA-A55M mongod[6604]: ...fail!
Oct 08 13:46:08 gariya-GA-A55M systemd[1]: mongod.service: control process exited, code=exited status=1
Oct 08 13:46:08 gariya-GA-A55M systemd[1]: Failed to start LSB: An object/document-oriented database.
Oct 08 13:46:08 gariya-GA-A55M systemd[1]: Unit mongod.service entered failed state.
Oct 08 13:46:08 gariya-GA-A55M systemd[1]: mongod.service failed.
有人请帮忙,我是 Ubuntu 和 MongoDB 的新手,我不明白是什么问题.
Someone please help, I am new to Ubuntu and MongoDB and I am not getting what is the problem.
推荐答案
有一个日志文件:/var/log/mongodb/mongod.log
在日志中我发现了以下内容:
In the log I've found the following:
Failed to unlink socket file /tmp/mongodb-27017.sock errno: Operation not permitted
这很可能来自之前的 MongoDB 版本.我删除了文件 (rm -rf/tmp/mongodb-27017.sock) 并完成了安装:
Most probably this was from previous MongoDB version. I deleted the file (rm -rf /tmp/mongodb-27017.sock) and finished the installation:
apt-get install mongodb-org
现在可以了.:-)
这篇关于Mongodb 无法在 Ubuntu 15.04 中启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!