mongod数据库意外down了,子进程在跑,主进程启动不来
报错信息如
ERROR: child process failed, exited with error number 1
Jun 9 14:31:02 dev-0006 systemd: Starting MongoDB Database Server...
Jun 9 14:31:02 dev-0006 mongod: about to fork child process, waiting until server is ready for connections.
Jun 9 14:31:02 dev-0006 mongod: forked process: 24025
Jun 9 14:31:03 dev-0006 mongod: ERROR: child process failed, exited with error number 14
Jun 9 14:31:03 dev-0006 mongod: To see additional information in this output, start without the "--fork" option.
Jun 9 14:31:03 dev-0006 systemd: mongod.service: control process exited, code=exited status=14
Jun 9 14:31:03 dev-0006 systemd: Failed to start MongoDB Database Server.
Jun 9 14:31:03 dev-0006 systemd: Unit mongod.service entered failed state.
Jun 9 14:31:03 dev-0006 systemd: mongod.service failed.
Jun 9 14:32:55 dev-0006 systemd: Starting MongoDB Database Server...
Jun 9 14:32:55 dev-0006 mongod: about to fork child process, waiting until server is ready for connections.
Jun 9 14:32:55 dev-0006 mongod: forked process: 24567
Jun 9 14:32:55 dev-0006 mongod: ERROR: child process failed, exited with error number 1
Jun 9 14:32:55 dev-0006 mongod: To see additional information in this output, start without the "--fork" option.
Jun 9 14:32:55 dev-0006 systemd: mongod.service: control process exited, code=exited status=1
Jun 9 14:32:55 dev-0006 systemd: Failed to start MongoDB Database Server.
Jun 9 14:32:55 dev-0006 systemd: Unit mongod.service entered failed state.
Jun 9 14:32:55 dev-0006 systemd: mongod.service failed.
不管怎么启动都是这个错误
找到的几个方法都是说修复和删除mongod.lock文件
mongod -f /etc/mongod.conf --repair
mongod --repair --dbpath /data/mongodb/lib/
尝试后,有人说启动了,但是我的没有启动了,尝试df查看磁盘空间,还有剩余,又重新设置了权限,然后在次启动,才启动成功
更改权限和确认磁盘空间后,再次启动服务启动成功
df -h
chown mongod:mongod /etc/mongod.conf
chown mongod:mongod /data/mongodb/ -R
systemctl start mongod