mongodb版本2.4.9,无法启动mongodb服务

时间:2018-03-28 15:47:33

标签: mongodb ubuntu installation nosql

我必须根据项目要求安装mongodb 2.4.9版。但安装后我无法启动mongodb服务。错误如下。

systemctl status mongodb.service
● mongodb.service
Loaded: loaded (/etc/init.d/mongodb; bad; vendor preset: enabled)
Active: failed (Result: exit-code) since ဟူး 2018-03-28 22:04:36 +0630; 28s ago
Docs: man:systemd-sysv-generator(8)
Process: 31482 ExecStart=/etc/init.d/mongodb start (code=exited, status=1/FAILURE)
မတ် 28 22:04:36 ubuntu mongodb[31482]: Rather than invoking init scripts through /etc/init.d, use the service(8)
မတ် 28 22:04:36 ubuntu mongodb[31482]: utility, e.g. service mongodb start
မတ် 28 22:04:36 ubuntu mongodb[31482]: initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
မတ် 28 22:04:36 ubuntu mongodb[31482]: Since the script you are attempting to invoke has been converted to an
မတ် 28 22:04:36 ubuntu mongodb[31482]: Upstart job, you may also use the start(8) utility, e.g. start mongodb
မတ် 28 22:04:36 ubuntu mongodb[31482]: start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
မတ် 28 22:04:36 ubuntu systemd[1]: mongodb.service: Control process exited, code=exited status=1
မတ် 28 22:04:36 ubuntu systemd[1]: Failed to start mongodb.service.
မတ် 28 22:04:36 ubuntu systemd[1]: mongodb.service: Unit entered failed state.
မတ် 28 22:04:36 ubuntu systemd[1]: mongodb.service: Failed with result 'exit-code'.

请..

1 个答案:

答案 0 :(得分:2)

因为sudo -u mongodb /usr/bin/mongod -f /etc/mongodb.conf应该启动mongod,所以/etc/init.d/monngodb -script ...

一定有问题