Mongodb在Ubuntu 16.04上不起作用 [英] Mongodb not working on Ubuntu 16.04
问题描述
我已按照本教程 ,安装过程中没有错误,但是当我尝试使用教程中提到的命令sudo systemctl start mongodb
启动mongod服务器时,尝试使用命令sudo systemctl status mongodb
检查它是否正在运行时出现此错误
I installed mongodb following this tutorial here, no errors during the installation but when I try to start the mongod server using this command sudo systemctl start mongodb
as the tutorial mentions, i getting this error when i try to check whether it is running using this command sudo systemctl status mongodb
.
● mongodb.service - High-performance, schema-free document-oriented
database
Loaded: loaded (/etc/systemd/system/mongodb.service; enabled; vendor preset:
Active: failed (Result: exit-code) since Rab 2016-06-01 18:04:20 MYT; 4s ago
Process: 8241 ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf (cod
Main PID: 8241 (code=exited, status=14)
Jun 01 18:04:20 yasinya systemd[1]: Started High-performance, schema-free docume
Jun 01 18:04:20 yasinya systemd[1]: mongodb.service: Main process exited, code=e
Jun 01 18:04:20 yasinya systemd[1]: mongodb.service: Unit entered failed state.
Jun 01 18:04:20 yasinya systemd[1]: mongodb.service: Failed with result 'exit-co
lines 1-10/10 (END)
所以任何人都可以告诉我哪里出了问题以及如何解决.
so can anyone tell what is wrong and how I can fix it.
推荐答案
最近我已经解决了相同的问题.我无法在googled上找到解决方案,但是我得到了线索,如何弄清楚.就我而言,此问题与mongodb-27017.sock文件有关.
Recently i have solved the same issue. I was unable to find the solution on googled, but i get come clues to, how get figure it out. In my case this issue was related to mongodb-27017.sock file.
Failed to unlink socket file /tmp/mongodb-27017.sock errno:1 Operation not permitted
因此,我已将/tmp/mongodb-27017.sock文件的权限更改为默认的mongodb
用户.
So i have changed the permission of /tmp/mongodb-27017.sock file to default mongodb
user.
sudo chown mongodb /tmp/mongodb-27017.sock
sudo chgrp mongodb /tmp/mongodb-27017.sock
此sudo systemctl status mongodb
正常工作并启动mongodb
之后.
After this sudo systemctl status mongodb
working fine and mongodb
is started.
这篇关于Mongodb在Ubuntu 16.04上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!