我刚安装了MongoDB v4.0.2,然后尝试启动该服务:
sudo systemctl start mongodb
然后获取其状态:
sudo systemctl status mongodb
我明白了:
mongodb.service - High-performance, schema-free document-oriented database
Loaded: loaded (/etc/systemd/system/mongodb.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2018-09-21 15:00:05 UTC; 1s ago
Process: 3460 ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf (code=exited, status=100)
Main PID: 3460 (code=exited, status=100)
发生了什么事?
编辑:I STORAGE [initandlisten] exception in initAndListen: DBPathInUse: Unable to lock the lock file: /var/lib/mongodb/mongod.lock (Unknown error). Another mongod instance is already running on the /var/lib/mongodb directory, terminating