Frequently the Mongodb cluster server stopped without any instruction. I was referred the mongodb log file,
# tail -f /var/log/mongodb/mongod.log
2015-12-02T07:10:24.466-0500 I JOURNAL [journal writer] Journal writer thread stopped
2015-12-02T07:10:24.466-0500 I JOURNAL [durability] Durability thread stopped
2015-12-02T07:10:24.467-0500 I STORAGE [signalProcessingThread] shutdown: closing all files...
2015-12-02T07:10:24.472-0500 I STORAGE [signalProcessingThread] closeAllFiles() finished
2015-12-02T07:10:24.472-0500 I STORAGE [signalProcessingThread] shutdown: removing fs lock...
2015-12-02T07:10:24.472-0500 I CONTROL [signalProcessingThread] dbexit: rc: 0
Finally got the simple solutions mongodb forums,
You can start the mongodb service with --fork option, fork for running in background.
# mongod --config /etc/mongod.conf --replSet rs1 --fork
Another ways is you can set replSet and fork in configure file
# vim /etc/mongod.conf
# Replication
replication:
replSetName: rs0
#fork
processManagement:
fork: true
Now start the mongod,
# mongod --config /etc/mongod.conf
To check the process status,
# ps aux | grep mongod
root 7530 0.0 0.0 11740 936 pts/0 S+ 09:07 0:00 grep --color=auto mongod
root 19540 0.6 11.7 5405856 119856 ? Sl 2015 312:22 mongod --config /etc/mongod.conf
Comments (0)