Environment: Ubuntu 20.04
mongo version: 7.0.4
Error:
systemctl status mongod
mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2024-10-20 00:20:28 CEST; 7h ago
Docs: https://docs.mongodb.org/manual
Process: 586388 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=1/FAILURE)
Main PID: 586388 (code=exited, status=1/FAILURE)
Warning: journal has been rotated since unit was started, output may be incomplete.
This has started happening recently. Currently I solve this by manually running ``systemctl start mongod` command in the terminal.
How to find the root cause of this issue?
The timing is around a cronjob.
crontab -e
0 23 * * * /root/scripts/cops-vps_CODE_backup.sh >> /root/scripts/logfile.log 2>&1 > /dev/null
0 0 * * * /root/scripts/cops-vps_backup.sh >> /root/scripts/logfile.log 2>&1 > /dev/null
part of cops-vps_backup.sh
#!/bin/bash
set -e
#start time var
######.... some variables setup
gzfile=$local_dumps_backupfolder/$vps_name--dump--$start_time.gz
dumpMsg="$vps_name mongodump StartTime:$start_time, EndTime:"
if mongodump --gzip --archive=$gzfile 2>&1 ; then
echo "DONE: $dumpMsg $(TZ=Asia/Calcutta date +%d-%m-%Y_%H-%M-%S)"
else
echo "ERR: $dumpMsg $(TZ=Asia/Calcutta date +%d-%m-%Y_%H-%M-%S)" | mailx -s "ERR: $vps_name mongodump" $recipient_email
exit
fi
#####..... some other file backup job
# rsync mongoDump
rsyncDumpMsg="$vps_name rsync mongodump backup files. StartTime:$start_time, EndTime:"
if rsync -avh $local_dumps_backupfolder $remote_base_backupfolder ; then
echo "DONE: $rsyncDumpMsg $(TZ=Asia/Calcutta date +%d-%m-%Y_%H-%M-%S)"
else
echo "ERR: $rsyncDumpMsg $(TZ=Asia/Calcutta date +%d-%m-%Y_%H-%M-%S)" | mailx -s "ERR: $vps_name mongodump rsync" $recipient_email
exit
fi
#final msg
final_msg="$vps_name mongodump-assets Backup Completed. StartTime:$start_time, EndTime: $(TZ=Asia/Calcutta date +%d-%m-%Y_%H-%M-%S)."
echo $final_msg | mailx -s "DONE: $vps_name mongodump-assets backup" $recipient_email
NOTE:
The mongodump backup file gets generated and also gets remote sync-ed to another vps.
NO error related email is triggered from script.