当我将环境从本地(mac)移动到服务器(ubuntu)时,我解压了我的目录和使用 npm install
安装的服务器,没有错误或警告,但我的数据库失败了,所以我决定根据本教程重新安装它(首先是apt-remove mongo*
)
https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-16-04
但后来我得到了
Job for mongodb.service failed because the control process exited with error code. See "systemctl status mongodb.service" and "journalctl -xe" for details.
有人知道这是什么意思吗?
-- Unit mongodb.service has begun starting up.
Jun 20 03:54:18 ip-172-31-16-163 mongodb[25271]: * Starting database mongodb
Jun 20 03:54:19 ip-172-31-16-163 mongodb[25271]: ...fail!
Jun 20 03:54:19 ip-172-31-16-163 systemd[1]: mongodb.service: Control process exited, code=exited status=1
Jun 20 03:54:19 ip-172-31-16-163 sudo[25268]: pam_unix(sudo:session): session closed for user root
Jun 20 03:54:19 ip-172-31-16-163 systemd[1]: Failed to start LSB: An object/document-oriented database.
-- Subject: Unit mongodb.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mongodb.service has failed.
--
-- The result is failed.
Jun 20 03:54:19 ip-172-31-16-163 systemd[1]: mongodb.service: Unit entered failed state.
Jun 20 03:54:19 ip-172-31-16-163 systemd[1]: mongodb.service: Failed with result 'exit-code'.
最佳答案
看起来很熟悉。检查文件的所有权。 dbPath 中的文件、mongod.run -lock 文件、 key 文件...
基本上是 /etc/mongod.conf
中列出的所有文件
关于Mongodb 无法启动 -> 显示奇怪的错误日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44643476/