简体   繁体   中英

mongo db not starting on the centos 7

when I run the command service mongod start

it says

Redirecting to /bin/systemctl start mongod.service
Job for mongod.service failed because the control process exited with error code. See "systemctl status mo
ngod.service" and "journalctl -xe" for details.

MongoDB was working fine but suddenly it stopped working and I tried to stop and start it and getting this error

contents of systemctl status mongod.service :-

● mongod.service - MongoDB Database Server
Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2020-04-13 18:15:40 IST; 3min 20s ago
    Docs: https://docs.mongodb.org/manual
Process: 23600 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=14)
Process: 23597 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited, status=0/SUCCESS)
Process: 23593 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (code=exited, status=0/SUCCESS)
Process: 23590 ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb (code=exited, status=0/SUCCESS)

Apr 13 18:15:40 localhost.localdomain systemd[1]: Starting MongoDB Database Server...
Apr 13 18:15:40 localhost.localdomain mongod[23600]: about to fork child process, waiting until server is ready for connections.
Apr 13 18:15:40 localhost.localdomain mongod[23600]: forked process: 23602
Apr 13 18:15:40 localhost.localdomain mongod[23600]: ERROR: child process failed, exited with error number 14
Apr 13 18:15:40 localhost.localdomain mongod[23600]: To see additional information in this output, start without the "--fork" option.
Apr 13 18:15:40 localhost.localdomain systemd[1]: mongod.service: control process exited, code=exited status=14
Apr 13 18:15:40 localhost.localdomain systemd[1]: Failed to start MongoDB Database Server.
Apr 13 18:15:40 localhost.localdomain systemd[1]: Unit mongod.service entered failed state.
Apr 13 18:15:40 localhost.localdomain systemd[1]: mongod.service failed.

what is the issue and how to resolve this?

this command service mongod start is not working and giving all sorts of error

use mongod --dbpath /var/lib/mongo --fork --logpath /var/log/mongodb/mongod.log

it works like charm.

I don't know the reason for what is wrong with service mongod start

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM