Issue
how could I relaunch mongodb service after killed by OOM
I couldn't find the reason why the mongodb service killed by OS about every 2 days. is there any workaround to launch the mongodb service when it got killed
I've already set some system configs to avoid killing the mongodb service
thanks so much
/etc/security/limits.conf
* hard nofile unlimited
* soft nofile unlimited
root hard nofile unlimited
root soft nofile unlimited
/etc/sysctl.conf
vm.oom-kill = 0
vm.overcommit_memory = 1
Solution
Try to add these lines in /etc/init/mongod.conf
respawn
respawn limit 10 100
it will retry restart the service in 100 seconds
Answered By - newBike Answer Checked By - Cary Denson (WPSolving Admin)