无法在Ubuntu 20.04上启动mongodb服务器

时间:2020-08-28 18:26:16

标签: mongodb installation ubuntu-20.04

我在ubuntu 20.04上安装了最新的mongodb,它给出了以下错误。请提出解决方案-

sudo systemctl status mongod

mongod.service - MongoDB Database Server
     Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Fri 2020-08-28 23:40:03 IST; 1min 43s ago
       Docs: https://docs.mongodb.org/manual
   Main PID: 10901 (code=exited, status=217/USER)

systemd[1]: Started MongoDB Database Server.
systemd[10901]: mongod.service: Failed to determine user credentials: No such process
systemd[10901]: mongod.service: Failed at step USER spawning /usr/bin/mongod: No such process
systemd[1]: mongod.service: Main process exited, code=exited, status=217/USER
systemd[1]: mongod.service: Failed with result 'exit-code'.
systemd[1]: /lib/systemd/system/mongod.service:11: PIDFile= references a path below legacy directory >

1 个答案:

答案 0 :(得分:0)

更改“ / var / lib / mongodb”目录的所有权对我有用。 更改所有权的命令:

sudo chown -R mongodb:mongodb / var / lib / mongodb