我跟随this link在我的计算机上安装MongoDB。一切都很好,并且有效。
当前,当我运行sudo systemctl status mongod
时,出现以下错误:
● mongod.service - High-performance, schema-free document-oriented database
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since سه<U+200C>شنبه 2019-05-21 15:50:14 +0430; 25min ago
Docs: https://docs.mongodb.org/manual
Process: 5278 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=1/FAILURE)
Main PID: 5278 (code=exited, status=1/FAILURE)
مه 21 15:50:14 [my-username] systemd[1]: Started High-performance, schema-free document-oriented database.
مه 21 15:50:14 [my-username] systemd[1]: mongod.service: Main process exited, code=exited, status=1/FAILURE
مه 21 15:50:14 [my-username] systemd[1]: mongod.service: Unit entered failed state.
مه 21 15:50:14 [my-username] systemd[1]: mongod.service: Failed with result 'exit-code'.
这是我在没问题之后所做的,这可能导致了问题:
pecl
添加mongodb扩展名。
无论是通过MongodDB Compassm还是通过Sell,我都无法创建新数据库。sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
命令后,我得到的是gpg: unchanged: 1
,而不是{{1} },这是我第一次获得。gpg: imported: 1 (RSA: 1)
文件夹(dbPath
),看来问题出在某种程度上与/var/lib/mongodb
上的此参数有关。运行/etc/mongod.conf
时,我仍然得到sudo systemctl status mongod
。
我该怎么做才能再次正确运行MongoDB并将其状态设置为Active: failed
?
更新:这是我的Active: Running
文件:
/etc/mongod.conf